Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32906734
D12186.1768198279.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D12186.1768198279.diff
View Options
diff --git a/native/account/logged-out-modal.react.js b/native/account/logged-out-modal.react.js
--- a/native/account/logged-out-modal.react.js
+++ b/native/account/logged-out-modal.react.js
@@ -282,24 +282,6 @@
} else if (prevProps.isForeground && !this.props.isForeground) {
this.onBackground();
}
-
- if (
- this.props.mode.curMode === 'prompt' &&
- prevProps.mode.curMode !== 'prompt'
- ) {
- this.props.buttonOpacity.setValue(0);
- Animated.timing(this.props.buttonOpacity, {
- easing: EasingNode.out(EasingNode.ease),
- duration: 250,
- toValue: 1.0,
- }).start();
- }
-
- const newContentHeight = this.props.dimensions.safeAreaHeight;
- const oldContentHeight = prevProps.dimensions.safeAreaHeight;
- if (newContentHeight !== oldContentHeight) {
- this.props.contentHeight.setValue(newContentHeight);
- }
}
onForeground() {
@@ -794,6 +776,30 @@
]);
}, [modeValue, keyboardHeightValue, proceedToNextMode]);
+ const onPrompt = mode.curMode === 'prompt';
+ const prevOnPromptRef = React.useRef(onPrompt);
+ React.useEffect(() => {
+ if (onPrompt && !prevOnPromptRef.current) {
+ buttonOpacity.setValue(0);
+ Animated.timing(buttonOpacity, {
+ easing: EasingNode.out(EasingNode.ease),
+ duration: 250,
+ toValue: 1.0,
+ }).start();
+ }
+ prevOnPromptRef.current = onPrompt;
+ }, [onPrompt, buttonOpacity]);
+
+ const curContentHeight = dimensions.safeAreaHeight;
+ const prevContentHeightRef = React.useRef(curContentHeight);
+ React.useEffect(() => {
+ if (curContentHeight === prevContentHeightRef.current) {
+ return;
+ }
+ prevContentHeightRef.current = curContentHeight;
+ contentHeight.setValue(curContentHeight);
+ }, [curContentHeight, contentHeight]);
+
const combinedSetMode = React.useCallback(
(newMode: LoggedOutMode) => {
nextModeRef.current = newMode;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 12, 6:11 AM (15 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5921964
Default Alt Text
D12186.1768198279.diff (1 KB)
Attached To
Mode
D12186: [native] Move animation logic in LoggedOutModal.componentDidUpdate to function component
Attached
Detach File
Event Timeline
Log In to Comment