A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
fix restore dialog
ammarahm-ed2d50f12c4995
diff --git a/apps/mobile/src/components/RestoreDialog/index.js b/apps/mobile/src/components/RestoreDialog/index.jsindex 4103583da..281ee5e52 100644--- a/apps/mobile/src/components/RestoreDialog/index.js+++ b/apps/mobile/src/components/RestoreDialog/index.js@@ -21,6 +21,7 @@ import BaseDialog from '../Dialog/base-dialog';import DialogButtons from '../Dialog/dialog-buttons';import DialogHeader from '../Dialog/dialog-header';import {Loading} from '../Loading';+import { Toast } from '../Toast';import Paragraph from '../Typography/Paragraph';const RestoreDialog = () => {@@ -44,6 +45,11 @@ const RestoreDialog = () => {};const close = () => {+ if (restoring) {+ ToastEvent.show('Please wait, we are restoring your data.','error','local');+ return;+ }+setVisible(false);};@@ -51,7 +57,7 @@ const RestoreDialog = () => {if (Platform.OS === 'android') {let granted = storage.requestPermission();if (!granted) {- ToastEvent.show('Restore Failed! Storage access denied');+ ToastEvent.show('Restore Failed! Storage access denied',"error","local");return;}}@@ -61,7 +67,7 @@ const RestoreDialog = () => {await sleep(2000);setRestoring(false);dispatch({type: Actions.ALL});- ToastEvent.show('Restore Complete!', 'success');+ ToastEvent.show('Restore Complete!', 'success',"local");setVisible(false);};@@ -99,28 +105,6 @@ const RestoreDialog = () => {backgroundColor: colors.bg,padding: 12,}}>- <BaseDialog visible={restoring}>- <View- style={{- ...getElevation(5),- width: '80%',- maxHeight: 350,- borderRadius: 5,- backgroundColor: colors.bg,- }}>- <Loading height={40} tagline="Resoring your data" />- <Paragraph- size={SIZE.xs}- color={colors.icon}- style={{- alignSelf: 'center',- textAlign: 'center',- }}>- Your data is being restored- </Paragraph>- </View>- </BaseDialog>-<DialogHeadertitle="Your Backups"paragraph="All backups stored in 'Phone Storage/Notesnook/backups'"@@ -155,10 +139,8 @@ const RestoreDialog = () => {borderBottomWidth: 0.5,borderBottomColor: colors.nav,}}>- <Paragraph size={SIZE.sm}>- {item.filename- .replace('notesnook_backup_', '')- .replace('.nnbackup', '')}+ <Paragraph size={SIZE.sm} style={{width: '70%'}}>+ {item.filename}</Paragraph><Button@@ -171,8 +153,10 @@ const RestoreDialog = () => {)}/>- <DialogButtons onPressNegative={close} />+ <DialogButtons loading={restoring} onPressNegative={close} />+</View>+ <Toast context="local" /></BaseDialog>);};diff --git a/apps/mobile/src/views/Settings/index.js b/apps/mobile/src/views/Settings/index.jsindex 82af3bf92..67888836b 100644--- a/apps/mobile/src/views/Settings/index.js+++ b/apps/mobile/src/views/Settings/index.js@@ -196,7 +196,7 @@ export const Settings = ({navigation}) => {func: () => {eSendEvent(eOpenRestoreDialog);},- desc: 'Restore backup from your phone.',+ desc: 'Restore a backup from your phone.',},];@@ -477,7 +477,7 @@ export const Settings = ({navigation}) => {}}>Accent Color{'\n'}<Paragraph size={SIZE.sm} color={colors.icon}>- Choose a color to use as accent color+ Change the accent color of the app.</Paragraph></Paragraph>@@ -550,13 +550,10 @@ export const Settings = ({navigation}) => {</View><CustomButton- title="Use System Dark Mode"- tagline={- settings.useSystemTheme- ? 'App will switch to dark mode based on system theme'- : 'App dark mode is independent from system theme'- }+ title="System Theme"+ tagline="Automatically switch to dark mode when the system theme changes."onPress={switchTheme}+ maxWidth="90%"customComponent={<Iconsize={SIZE.xl}@@ -570,9 +567,7 @@ export const Settings = ({navigation}) => {<CustomButtontitle="Dark Mode"- tagline={- colors.night ? 'Dark mode is turned off' : 'Dark mode is turned on'- }+ tagline="Switch on dark mode at night to protect your eyes."onPress={async () => {if (!colors.night) {await MMKV.setStringAsync('theme', JSON.stringify({night: true}));@@ -586,6 +581,7 @@ export const Settings = ({navigation}) => {changeColorScheme(COLOR_SCHEME_LIGHT);}}}+ maxWidth="90%"customComponent={<Iconsize={SIZE.xl}@@ -759,11 +755,7 @@ export const Settings = ({navigation}) => {<CustomButtonkey="privacyMode"title="Privacy Mode"- tagline={- settings.privacyScreen- ? 'App contents will be hidden when app goes in background and screenshots are disabled'- : 'App contents can be seen when app goes in background and screenshots are enabled'- }+ tagline="Hide app contents when you switch to other apps. This will also disable screenshot taking in the app."onPress={() => {Platform.OS === 'android'? AndroidModule.setSecureMode(!settings.privacyScreen)@@ -788,11 +780,7 @@ export const Settings = ({navigation}) => {<CustomButtonkey="fingerprintVaultUnlock"title="Unlock vault with Fingerprint"- tagline={- !vaultStatus.biometryEnrolled- ? 'Enable access to the vault with fingerprint.'- : 'You can access the vault with fingerprint.'- }+ tagline="Access vault with fingerprint."onPress={() => {openVault({item: {},@@ -833,7 +821,7 @@ export const Settings = ({navigation}) => {<CustomButtonkey="createVault"title="Create Vault"- tagline="Adds an extra layer of security for most important notes."+ tagline="Secure your notes by adding the to the vault."onPress={() => {openVault({item: {},@@ -972,8 +960,8 @@ export const Settings = ({navigation}) => {</View><CustomButton- title="Encrypted Backups"- tagline="Encrypt your data before backup"+ title="Backup Encryption"+ tagline="Backups will be encrypted."onPress={async () => {if (!user) {ToastEvent.show(