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
mobile: request backup before changing password
Ammar Ahmed9027c4451147
diff --git a/apps/mobile/app/components/auth/change-password.js b/apps/mobile/app/components/auth/change-password.jsindex 467cd1a7c..c6c5389da 100644--- a/apps/mobile/app/components/auth/change-password.js+++ b/apps/mobile/app/components/auth/change-password.js@@ -32,6 +32,8 @@ import { Button } from "../ui/button";import Input from "../ui/input";import { Notice } from "../ui/notice";import Seperator from "../ui/seperator";+import { Dialog } from "../dialog";+import BackupService from "../../services/backup";export const ChangePassword = () => {const passwordInputRef = useRef();@@ -64,6 +66,7 @@ export const ChangePassword = () => {}setLoading(true);try {+ await BackupService.run(false, "change-password-dialog");await db.user.clearSessions();await db.user.changePassword(oldPassword.current, password.current);ToastEvent.show({@@ -92,6 +95,7 @@ export const ChangePassword = () => {padding: 12}}>+ <Dialog context="change-password-dialog" /><DialogHeadertitle="Change password"paragraph="Enter your old and new passwords"diff --git a/apps/mobile/app/services/backup.js b/apps/mobile/app/services/backup.jsindex 0cf58fdba..13b3ed372 100644--- a/apps/mobile/app/services/backup.js+++ b/apps/mobile/app/services/backup.js@@ -213,10 +213,12 @@ async function run(progress, context) {RNFetchBlob.fs.unlink(zipSourceFolder).catch(console.log);updateNextBackupTime();- let showBackupCompleteSheet = SettingsService.get().showBackupCompleteSheet;+ let showBackupCompleteSheet =+ progress && SettingsService.get().showBackupCompleteSheet;if (context) return path;await sleep(300);+if (showBackupCompleteSheet) {presentBackupCompleteSheet(backupFilePath);} else {@@ -233,7 +235,7 @@ async function run(progress, context) {return path;} catch (e) {await sleep(300);- eSendEvent(eCloseSheet);+ progress && eSendEvent(eCloseSheet);ToastEvent.error(e, "Backup failed!");return null;}