Page MenuHomePhabricator

D6097.id20408.diff
No OneTemporary

D6097.id20408.diff

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

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)

Event Timeline