MCPcopy Index your code
hub / github.com/BlueWallet/BlueWallet / onEncryptStorageSwitch

Function onEncryptStorageSwitch

screen/settings/EncryptStorage.tsx:102–134  ·  view source on GitHub ↗
(value: boolean)

Source from the content-addressed store, hash-verified

100 };
101
102 const onEncryptStorageSwitch = async (value: boolean) => {
103 dispatch({ type: ActionType.SetCurrentLoadingSwitch, payload: 'encrypt' });
104 dispatch({ type: ActionType.SetLoading, payload: true });
105
106 if (value) {
107 dispatch({ type: ActionType.SetModalType, payload: MODAL_TYPES.CREATE_PASSWORD });
108 navigation.navigate('PromptPasswordConfirmationSheet', {
109 modalType: MODAL_TYPES.CREATE_PASSWORD,
110 returnTo: 'EncryptStorage',
111 });
112 } else {
113 Alert.alert(
114 loc.settings.encrypt_decrypt,
115 loc.settings.encrypt_decrypt_q,
116 [
117 {
118 text: loc._.cancel,
119 style: 'cancel',
120 onPress: () => {
121 dispatch({ type: ActionType.SetLoading, payload: false });
122 dispatch({ type: ActionType.SetCurrentLoadingSwitch, payload: null });
123 },
124 },
125 {
126 text: loc._.ok,
127 style: 'destructive',
128 onPress: handleDecryptStorage,
129 },
130 ],
131 { cancelable: false },
132 );
133 }
134 };
135
136 const onUseBiometricSwitch = async (value: boolean) => {
137 dispatch({ type: ActionType.SetCurrentLoadingSwitch, payload: 'biometric' });

Callers

nothing calls this directly

Calls 1

dispatchFunction · 0.85

Tested by

no test coverage detected