Page MenuHomePhabricator

D7840.diff
No OneTemporary

D7840.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
@@ -599,7 +599,7 @@
siwePanel = (
<SIWEPanel
onClose={this.goBackToPrompt}
- nextMode={this.state.nextMode}
+ closing={this.state.nextMode === 'prompt'}
/>
);
}
diff --git a/native/account/siwe-panel.react.js b/native/account/siwe-panel.react.js
--- a/native/account/siwe-panel.react.js
+++ b/native/account/siwe-panel.react.js
@@ -20,7 +20,6 @@
useDispatchActionPromise,
} from 'lib/utils/action-utils.js';
-import type { LoggedOutMode } from './logged-out-modal.react.js';
import { commCoreModule } from '../native-modules.js';
import { NavContext } from '../navigation/navigation-context.js';
import { useSelector } from '../redux/redux-utils.js';
@@ -37,7 +36,7 @@
type Props = {
+onClose: () => mixed,
- +nextMode: LoggedOutMode,
+ +closing: boolean,
};
function SIWEPanel(props: Props): React.Node {
const navContext = React.useContext(NavContext);
@@ -151,7 +150,7 @@
[logInExtraInfo, dispatchActionPromise, callSIWE],
);
const closeBottomSheet = bottomSheetRef.current?.close;
- const { nextMode } = props;
+ const { closing } = props;
const disableOnClose = React.useRef(false);
const handleMessage = React.useCallback(
async event => {
@@ -172,13 +171,13 @@
},
[handleSIWE, onClose, closeBottomSheet],
);
- const prevNextModeRef = React.useRef();
+ const prevClosingRef = React.useRef();
React.useEffect(() => {
- if (nextMode === 'prompt' && prevNextModeRef.current === 'siwe') {
+ if (closing && !prevClosingRef.current) {
closeBottomSheet?.();
}
- prevNextModeRef.current = nextMode;
- }, [nextMode, closeBottomSheet]);
+ prevClosingRef.current = closing;
+ }, [closing, closeBottomSheet]);
const source = React.useMemo(
() => ({

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 27, 6:56 AM (9 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2711565
Default Alt Text
D7840.diff (1 KB)

Event Timeline