FIX: poptotop should be in screen nor modal

This commit is contained in:
Marcos Rodriguez Velez 2024-08-11 14:41:45 -04:00
parent 1c61de7a32
commit e5f0c603ef
4 changed files with 11 additions and 6 deletions

View File

@ -24,8 +24,8 @@ GEM
artifactory (3.0.17) artifactory (3.0.17)
atomos (0.1.3) atomos (0.1.3)
aws-eventstream (1.3.0) aws-eventstream (1.3.0)
aws-partitions (1.962.0) aws-partitions (1.963.0)
aws-sdk-core (3.201.3) aws-sdk-core (3.201.4)
aws-eventstream (~> 1, >= 1.3.0) aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0) aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.8) aws-sigv4 (~> 1.8)
@ -84,7 +84,7 @@ GEM
colored2 (3.1.2) colored2 (3.1.2)
commander (4.6.0) commander (4.6.0)
highline (~> 2.0.0) highline (~> 2.0.0)
concurrent-ruby (1.3.3) concurrent-ruby (1.3.4)
connection_pool (2.4.1) connection_pool (2.4.1)
declarative (0.0.20) declarative (0.0.20)
digest-crc (0.6.5) digest-crc (0.6.5)

View File

@ -5,7 +5,6 @@ import { useTheme } from '../components/themes';
import loc from '../loc'; import loc from '../loc';
import { SecondButton } from './SecondButton'; import { SecondButton } from './SecondButton';
import triggerHapticFeedback, { HapticFeedbackTypes } from '../blue_modules/hapticFeedback'; import triggerHapticFeedback, { HapticFeedbackTypes } from '../blue_modules/hapticFeedback';
import { popToTop } from '../NavigationService';
export const MODAL_TYPES = { export const MODAL_TYPES = {
ENTER_PASSWORD: 'ENTER_PASSWORD', ENTER_PASSWORD: 'ENTER_PASSWORD',
@ -161,7 +160,6 @@ const PromptPasswordConfirmationModal = forwardRef<PromptPasswordConfirmationMod
}).start(() => { }).start(() => {
setTimeout(async () => { setTimeout(async () => {
await modalRef.current?.dismiss(); await modalRef.current?.dismiss();
popToTop();
}, 1000); }, 1000);
}); });
}); });

View File

@ -10,6 +10,7 @@ import PromptPasswordConfirmationModal, {
PromptPasswordConfirmationModalHandle, PromptPasswordConfirmationModalHandle,
MODAL_TYPES, MODAL_TYPES,
} from '../components/PromptPasswordConfirmationModal'; } from '../components/PromptPasswordConfirmationModal';
import { popToTop } from '../NavigationService';
// Action Types // Action Types
const SET_LOADING = 'SET_LOADING'; const SET_LOADING = 'SET_LOADING';
@ -48,6 +49,7 @@ const PlausibleDeniability: React.FC = () => {
const promptRef = useRef<PromptPasswordConfirmationModalHandle>(null); const promptRef = useRef<PromptPasswordConfirmationModalHandle>(null);
const handleOnCreateFakeStorageButtonPressed = async () => { const handleOnCreateFakeStorageButtonPressed = async () => {
dispatch({ type: SET_LOADING, payload: true });
dispatch({ type: SET_MODAL_TYPE, payload: MODAL_TYPES.CREATE_FAKE_STORAGE }); dispatch({ type: SET_MODAL_TYPE, payload: MODAL_TYPES.CREATE_FAKE_STORAGE });
promptRef.current?.present(); promptRef.current?.present();
}; };
@ -70,8 +72,12 @@ const PlausibleDeniability: React.FC = () => {
dispatch({ type: SET_MODAL_TYPE, payload: MODAL_TYPES.SUCCESS }); dispatch({ type: SET_MODAL_TYPE, payload: MODAL_TYPES.SUCCESS });
success = true; success = true;
setTimeout(() => {
popToTop();
}, 1500);
} catch { } catch {
success = false; success = false;
dispatch({ type: SET_LOADING, payload: false });
} }
return success; return success;
@ -95,6 +101,7 @@ const PlausibleDeniability: React.FC = () => {
testID="CreateFakeStorageButton" testID="CreateFakeStorageButton"
title={loc.plausibledeniability.create_fake_storage} title={loc.plausibledeniability.create_fake_storage}
onPress={handleOnCreateFakeStorageButtonPressed} onPress={handleOnCreateFakeStorageButtonPressed}
disabled={state.isLoading}
/> />
</BlueCard> </BlueCard>
)} )}

View File

@ -407,7 +407,7 @@ describe('BlueWallet UI Tests - no wallets', () => {
// trying to enable plausible denability // trying to enable plausible denability
await element(by.id('CreateFakeStorageButton')).tap(); await element(by.id('CreateFakeStorageButton')).tap();
await element(by.id('IUnderstandButton')).tap(); await element(by.id('IUnderstandButton')).tap();
await element(by.id('PasswordInput')).typeText('fake'); await element(by.id('PasswordInput')).typeText('fake');
await element(by.id('PasswordInput')).tapReturnKey(); await element(by.id('PasswordInput')).tapReturnKey();
await element(by.id('ConfirmPasswordInput')).typeText('fake'); // retyping await element(by.id('ConfirmPasswordInput')).typeText('fake'); // retyping