mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-03-15 11:59:21 +01:00
FIX: DIscard changes alert was not working
This commit is contained in:
parent
10b3432e0e
commit
ae89a59794
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,14 +227,16 @@ 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', onPress: () => resolve() },
|
{ text: loc._.cancel, style: 'cancel' },
|
||||||
{ text: loc._.ok, style: 'default', onPress: () => resolve() },
|
{
|
||||||
|
text: loc._.ok,
|
||||||
|
style: 'destructive',
|
||||||
|
onPress: () => navigationDispatch(preventRemoveData.action),
|
||||||
|
},
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
const handleClose = useCallback(() => {
|
const handleClose = useCallback(() => {
|
||||||
if (state.searchQuery.length === 0 && !state.isSearchFocused) {
|
if (state.searchQuery.length === 0 && !state.isSearchFocused) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue