Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3494243
D6097.id20408.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D6097.id20408.diff
View Options
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
@@ -2,7 +2,7 @@
import BottomSheet from '@gorhom/bottom-sheet';
import * as React from 'react';
-import { ActivityIndicator, Text, View, Alert } from 'react-native';
+import { ActivityIndicator, View, Alert } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import WebView from 'react-native-webview';
@@ -55,6 +55,19 @@
const getSIWENonceCallFailed = useSelector(
state => getSIWENonceLoadingStatusSelector(state) === 'error',
);
+
+ const { onClose } = props;
+ React.useEffect(() => {
+ if (getSIWENonceCallFailed) {
+ Alert.alert(
+ 'Unknown error',
+ 'Uhh... try again?',
+ [{ text: 'OK', onPress: onClose }],
+ { cancelable: false },
+ );
+ }
+ }, [getSIWENonceCallFailed, onClose]);
+
const siweAuthCallLoading = useSelector(
state => siweAuthLoadingStatusSelector(state) === 'loading',
);
@@ -97,7 +110,6 @@
snapToIndex?.(0);
}, [snapToIndex, snapPoints]);
- const { onClose } = props;
const callSIWE = React.useCallback(
async (message, signature, extraInfo) => {
try {
@@ -225,9 +237,7 @@
}
let activity;
- if (getSIWENonceCallFailed) {
- activity = <Text>Oops, try again later!</Text>;
- } else if (isLoading || siweAuthCallLoading) {
+ if (!getSIWENonceCallFailed && (isLoading || siweAuthCallLoading)) {
activity = <ActivityIndicator size="large" />;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 4:48 AM (19 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2679957
Default Alt Text
D6097.id20408.diff (1 KB)
Attached To
Mode
D6097: [native] Handle errors with SIWE WebView
Attached
Detach File
Event Timeline
Log In to Comment