Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3373129
D7929.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D7929.diff
View Options
diff --git a/native/account/fullscreen-siwe-panel.react.js b/native/account/fullscreen-siwe-panel.react.js
--- a/native/account/fullscreen-siwe-panel.react.js
+++ b/native/account/fullscreen-siwe-panel.react.js
@@ -9,7 +9,7 @@
import SIWEPanel from './siwe-panel.react.js';
type Props = {
- +onClose: () => mixed,
+ +goBackToPrompt: () => mixed,
+closing: boolean,
};
function FullscreenSIWEPanel(props: Props): React.Node {
@@ -24,18 +24,18 @@
[],
);
- const onCloseProp = props.onClose;
+ const { goBackToPrompt } = props;
const siweServerCallParams = React.useMemo(() => {
const onServerCallFailure = () => {
Alert.alert(
'Unknown error',
'Uhh... try again?',
- [{ text: 'OK', onPress: onCloseProp }],
+ [{ text: 'OK', onPress: goBackToPrompt }],
{ cancelable: false },
);
};
return { onFailure: onServerCallFailure };
- }, [onCloseProp]);
+ }, [goBackToPrompt]);
const siweServerCall = useSIWEServerCall(siweServerCallParams);
const successRef = React.useRef(false);
@@ -47,11 +47,11 @@
[siweServerCall],
);
- const onClose = React.useCallback(() => {
+ const ifBeforeSuccessGoBackToPrompt = React.useCallback(() => {
if (!successRef.current) {
- onCloseProp();
+ goBackToPrompt();
}
- }, [onCloseProp]);
+ }, [goBackToPrompt]);
const { closing } = props;
return (
@@ -59,8 +59,8 @@
<View style={activityContainer}>{activity}</View>
<SIWEPanel
closing={closing}
- onClosed={onClose}
- onClosing={onClose}
+ onClosed={ifBeforeSuccessGoBackToPrompt}
+ onClosing={ifBeforeSuccessGoBackToPrompt}
onSuccessfulWalletSignature={onSuccess}
setLoading={setLoading}
/>
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
@@ -598,7 +598,7 @@
if (this.state.mode === 'siwe') {
siwePanel = (
<FullscreenSIWEPanel
- onClose={this.goBackToPrompt}
+ goBackToPrompt={this.goBackToPrompt}
closing={this.state.nextMode === 'prompt'}
/>
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 27, 8:26 AM (22 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2589790
Default Alt Text
D7929.diff (2 KB)
Attached To
Mode
D7929: [native] Rename FullscreenSIWEPanel onClose prop to goBackToPrompt
Attached
Detach File
Event Timeline
Log In to Comment