Page MenuHomePhabricator

D12187.diff
No OneTemporary

D12187.diff

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
@@ -240,6 +240,8 @@
+panelOpacity: Node,
+combinedSetMode: LoggedOutMode => void,
+goBackToPrompt: () => void,
+ +activeAlertRef: { current: boolean },
+ +setActiveAlert: boolean => void,
// Navigation state
+isForeground: boolean,
// Redux state
@@ -256,8 +258,6 @@
keyboardShowListener: ?EventSubscription;
keyboardHideListener: ?EventSubscription;
- activeAlert = false;
-
componentDidMount() {
if (this.props.rehydrateConcluded) {
this.onInitialAppLoad();
@@ -359,15 +359,11 @@
};
keyboardHide = () => {
- if (!this.activeAlert) {
+ if (!this.props.activeAlertRef.current) {
this.props.keyboardHeightValue.setValue(0);
}
};
- setActiveAlert = (activeAlert: boolean) => {
- this.activeAlert = activeAlert;
- };
-
render(): React.Node {
const { styles } = this.props;
@@ -398,7 +394,7 @@
if (this.props.mode.curMode === 'log-in') {
panel = (
<LogInPanel
- setActiveAlert={this.setActiveAlert}
+ setActiveAlert={this.props.setActiveAlert}
opacityValue={this.props.panelOpacity}
logInState={this.props.logInStateContainer}
/>
@@ -406,7 +402,7 @@
} else if (this.props.mode.curMode === 'register') {
panel = (
<LegacyRegisterPanel
- setActiveAlert={this.setActiveAlert}
+ setActiveAlert={this.props.setActiveAlert}
opacityValue={this.props.panelOpacity}
legacyRegisterState={this.props.legacyRegisterStateContainer}
/>
@@ -825,6 +821,11 @@
}
}, [persistedStateLoaded, combinedSetMode]);
+ const activeAlertRef = React.useRef(false);
+ const setActiveAlert = React.useCallback((activeAlert: boolean) => {
+ activeAlertRef.current = activeAlert;
+ }, []);
+
const navContext = React.useContext(NavContext);
const isForeground = isForegroundSelector(navContext);
@@ -851,6 +852,8 @@
panelOpacity={panelOpacity}
combinedSetMode={combinedSetMode}
goBackToPrompt={goBackToPrompt}
+ activeAlertRef={activeAlertRef}
+ setActiveAlert={setActiveAlert}
isForeground={isForeground}
rehydrateConcluded={rehydrateConcluded}
cookie={cookie}

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 10:42 AM (21 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2575053
Default Alt Text
D12187.diff (2 KB)

Event Timeline