Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3521832
D5985.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D5985.diff
View Options
diff --git a/web/chat/chat-message-list.react.js b/web/chat/chat-message-list.react.js
--- a/web/chat/chat-message-list.react.js
+++ b/web/chat/chat-message-list.react.js
@@ -36,6 +36,10 @@
import RelationshipPrompt from './relationship-prompt/relationship-prompt';
import { useTooltipContext } from './tooltip-provider';
+const browser = detectBrowser();
+const supportsReverseFlex =
+ !browser || browser.name !== 'firefox' || parseInt(browser.version) >= 81;
+
type BaseProps = {
+threadInfo: ThreadInfo,
};
@@ -46,7 +50,6 @@
+activeChatThreadID: ?string,
+messageListData: ?$ReadOnlyArray<ChatMessageItem>,
+startReached: boolean,
- +supportsReverseFlex: boolean,
// Redux dispatch functions
+dispatchActionPromise: DispatchActionPromise,
// async functions that hit server APIs
@@ -139,7 +142,7 @@
) {
const newHeight = scrollHeight - snapshot.scrollHeight;
const newScrollTop = Math.abs(scrollTop) + newHeight;
- if (this.props.supportsReverseFlex) {
+ if (supportsReverseFlex) {
messageContainer.scrollTop = -1 * newScrollTop;
} else {
messageContainer.scrollTop = newScrollTop;
@@ -195,7 +198,7 @@
const messageContainerStyle = classNames({
[css.messageContainer]: true,
- [css.mirroredMessageContainer]: !this.props.supportsReverseFlex,
+ [css.mirroredMessageContainer]: !supportsReverseFlex,
});
return (
<div className={css.outerMessageContainer}>
@@ -277,16 +280,6 @@
const ConnectedChatMessageList: React.ComponentType<BaseProps> = React.memo<BaseProps>(
function ConnectedChatMessageList(props: BaseProps): React.Node {
const { threadInfo } = props;
- const userAgent = useSelector(state => state.userAgent);
- const supportsReverseFlex = React.useMemo(() => {
- const browser = detectBrowser(userAgent);
- return (
- !browser ||
- browser.name !== 'firefox' ||
- parseInt(browser.version) >= 81
- );
- }, [userAgent]);
-
const messageListData = useMessageListData({
threadInfo,
searching: false,
@@ -335,7 +328,6 @@
threadInfo={threadInfo}
messageListData={messageListData}
startReached={startReached}
- supportsReverseFlex={supportsReverseFlex}
inputState={inputState}
dispatchActionPromise={dispatchActionPromise}
fetchMessagesBeforeCursor={callFetchMessagesBeforeCursor}
diff --git a/web/input/input-state-container.react.js b/web/input/input-state-container.react.js
--- a/web/input/input-state-container.react.js
+++ b/web/input/input-state-container.react.js
@@ -82,6 +82,10 @@
import { nonThreadCalendarQuery } from '../selectors/nav-selectors';
import { type PendingMultimediaUpload, InputStateContext } from './input-state';
+const browser = detectBrowser();
+const exifRotate =
+ !browser || (browser.name !== 'safari' && browser.name !== 'chrome');
+
type BaseProps = {
+children: React.Node,
};
@@ -91,7 +95,6 @@
+drafts: { +[key: string]: string },
+viewerID: ?string,
+messageStoreMessages: { +[id: string]: RawMessageInfo },
- +exifRotate: boolean,
+pendingRealizedThreadIDs: $ReadOnlyMap<string, string>,
+dispatch: Dispatch,
+dispatchActionPromise: DispatchActionPromise,
@@ -606,7 +609,7 @@
let response;
const validationStart = Date.now();
try {
- response = await validateFile(file, this.props.exifRotate);
+ response = await validateFile(file, exifRotate);
} catch (e) {
return {
steps,
@@ -1255,12 +1258,6 @@
const ConnectedInputStateContainer: React.ComponentType<BaseProps> = React.memo<BaseProps>(
function ConnectedInputStateContainer(props) {
- const exifRotate = useSelector(state => {
- const browser = detectBrowser(state.userAgent);
- return (
- !browser || (browser.name !== 'safari' && browser.name !== 'chrome')
- );
- });
const activeChatThreadID = useSelector(
state => state.navInfo.activeChatThreadID,
);
@@ -1308,7 +1305,6 @@
drafts={drafts}
viewerID={viewerID}
messageStoreMessages={messageStoreMessages}
- exifRotate={exifRotate}
pendingRealizedThreadIDs={pendingToRealizedThreadIDs}
calendarQuery={calendarQuery}
uploadMultimedia={callUploadMultimedia}
diff --git a/web/redux/redux-setup.js b/web/redux/redux-setup.js
--- a/web/redux/redux-setup.js
+++ b/web/redux/redux-setup.js
@@ -64,7 +64,6 @@
enabledApps: EnabledApps,
reportStore: ReportStore,
nextLocalID: number,
- userAgent: ?string,
dataLoaded: boolean,
windowActive: boolean,
userPolicies: UserPolicies,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 24, 4:58 AM (19 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2698391
Default Alt Text
D5985.diff (4 KB)
Attached To
Mode
D5985: [web] Remove userAgent from Redux state
Attached
Detach File
Event Timeline
Log In to Comment