mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-13 11:09:20 +01:00
Merge pull request #7684 from BlueWallet/man
FIX: DIscard changes alert was not working
This commit is contained in:
commit
0b1c3dd9f7
2 changed files with 11 additions and 9 deletions
|
@ -364,7 +364,7 @@ const DetailViewStackScreensStack = () => {
|
||||||
options={navigationStyle({
|
options={navigationStyle({
|
||||||
headerBackVisible: false,
|
headerBackVisible: false,
|
||||||
gestureEnabled: false,
|
gestureEnabled: false,
|
||||||
presentation: 'containedModal',
|
presentation: 'fullScreenModal',
|
||||||
title: loc.wallets.manage_title,
|
title: loc.wallets.manage_title,
|
||||||
statusBarStyle: 'auto',
|
statusBarStyle: 'auto',
|
||||||
})(theme)}
|
})(theme)}
|
||||||
|
|
|
@ -192,7 +192,7 @@ const ManageWallets: React.FC = () => {
|
||||||
const { wallets: storedWallets, setWalletsWithNewOrder, txMetadata, handleWalletDeletion } = useStorage();
|
const { wallets: storedWallets, setWalletsWithNewOrder, txMetadata, handleWalletDeletion } = useStorage();
|
||||||
const { setIsDrawerShouldHide } = useSettings();
|
const { setIsDrawerShouldHide } = useSettings();
|
||||||
const walletsRef = useRef<TWallet[]>(deepCopyWallets(storedWallets)); // Create a deep copy of wallets for the DraggableFlatList
|
const walletsRef = useRef<TWallet[]>(deepCopyWallets(storedWallets)); // Create a deep copy of wallets for the DraggableFlatList
|
||||||
const { navigate, setOptions, goBack } = useExtendedNavigation();
|
const { navigate, setOptions, goBack, dispatch: navigationDispatch } = useExtendedNavigation();
|
||||||
const [state, dispatch] = useReducer(reducer, initialState);
|
const [state, dispatch] = useReducer(reducer, initialState);
|
||||||
const debouncedSearchQuery = useDebounce(state.searchQuery, 300);
|
const debouncedSearchQuery = useDebounce(state.searchQuery, 300);
|
||||||
const bounceAnim = useBounceAnimation(state.searchQuery);
|
const bounceAnim = useBounceAnimation(state.searchQuery);
|
||||||
|
@ -227,13 +227,15 @@ const ManageWallets: React.FC = () => {
|
||||||
return JSON.stringify(walletsRef.current) !== JSON.stringify(state.tempOrder.map(item => item.data));
|
return JSON.stringify(walletsRef.current) !== JSON.stringify(state.tempOrder.map(item => item.data));
|
||||||
}, [state.tempOrder]);
|
}, [state.tempOrder]);
|
||||||
|
|
||||||
usePreventRemove(hasUnsavedChanges, async () => {
|
usePreventRemove(hasUnsavedChanges, ({ data: preventRemoveData }) => {
|
||||||
await new Promise<void>(resolve => {
|
Alert.alert(loc._.discard_changes, loc._.discard_changes_explain, [
|
||||||
Alert.alert(loc._.discard_changes, loc._.discard_changes_explain, [
|
{ text: loc._.cancel, style: 'cancel' },
|
||||||
{ text: loc._.cancel, style: 'cancel', onPress: () => resolve() },
|
{
|
||||||
{ text: loc._.ok, style: 'default', onPress: () => resolve() },
|
text: loc._.ok,
|
||||||
]);
|
style: 'destructive',
|
||||||
});
|
onPress: () => navigationDispatch(preventRemoveData.action),
|
||||||
|
},
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleClose = useCallback(() => {
|
const handleClose = useCallback(() => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue