Page MenuHomePhabricator

D6553.diff
No OneTemporary

D6553.diff

diff --git a/native/chat/chat-context-provider.react.js b/native/chat/chat-context-provider.react.js
--- a/native/chat/chat-context-provider.react.js
+++ b/native/chat/chat-context-provider.react.js
@@ -126,11 +126,6 @@
sidebarAnimationType,
setSidebarAnimationType,
] = React.useState<SidebarAnimationType>('move_source_message');
- const setSidebarAnimationTypeCallback = React.useCallback(
- (animationType: SidebarAnimationType) =>
- setSidebarAnimationType(animationType),
- [],
- );
const contextValue = React.useMemo(
() => ({
@@ -141,14 +136,13 @@
deleteChatInputBarHeight,
chatInputBarHeights: chatInputBarHeights.current,
sidebarAnimationType,
- setSidebarAnimationType: setSidebarAnimationTypeCallback,
+ setSidebarAnimationType,
}),
[
currentTransitionSidebarSourceID,
deleteChatInputBarHeight,
registerMeasurer,
setChatInputBarHeight,
- setSidebarAnimationTypeCallback,
sidebarAnimationType,
],
);
diff --git a/native/chat/utils.js b/native/chat/utils.js
--- a/native/chat/utils.js
+++ b/native/chat/utils.js
@@ -227,24 +227,17 @@
const currentInputBarHeight =
chatInputBarHeights.get(sourceMessage.threadInfo.id) ?? 0;
const keyboardState = React.useContext(KeyboardContext);
- const viewerIsSidebarMember = viewerIsMember(sidebarThreadInfo);
+
+ const newSidebarAnimationType =
+ !currentInputBarHeight ||
+ !targetInputBarHeight ||
+ keyboardState?.keyboardShowing ||
+ !viewerIsMember(sidebarThreadInfo)
+ ? 'fade_source_message'
+ : 'move_source_message';
React.useEffect(() => {
- const newSidebarAnimationType =
- !currentInputBarHeight ||
- !targetInputBarHeight ||
- keyboardState?.keyboardShowing ||
- !viewerIsSidebarMember
- ? 'fade_source_message'
- : 'move_source_message';
setSidebarAnimationType(newSidebarAnimationType);
- }, [
- currentInputBarHeight,
- keyboardState?.keyboardShowing,
- setSidebarAnimationType,
- sidebarThreadInfo,
- targetInputBarHeight,
- viewerIsSidebarMember,
- ]);
+ }, [setSidebarAnimationType, newSidebarAnimationType]);
const {
position: targetPosition,

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 21, 1:58 PM (19 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2687917
Default Alt Text
D6553.diff (2 KB)

Event Timeline