From 104c15453038f925c94242a6ca0c8cb3aad57c99 Mon Sep 17 00:00:00 2001 From: Mahyar Mirrashed Date: Mon, 3 Jul 2023 05:02:09 -0500 Subject: [PATCH] feat: add notice when vault successfully backs up --- src/controllers/syncController.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/controllers/syncController.ts b/src/controllers/syncController.ts index ea79754..6f7a0d4 100644 --- a/src/controllers/syncController.ts +++ b/src/controllers/syncController.ts @@ -28,7 +28,7 @@ export default class SyncController { try { await this.gitService.gitPush(); - logger.success("Created vault backup."); + this.notifyUserAboutBackup(); } catch { logger.warn("Remote and local have conflicting changes!"); logger.info("Starting rebase process..."); @@ -37,7 +37,7 @@ export default class SyncController { await this.gitService.gitPullWithRebase(); await this.gitService.gitPush(); - logger.success("Created vault backup."); + this.notifyUserAboutBackup(); } catch { logger.error("Automatic rebasing failed."); @@ -53,6 +53,12 @@ export default class SyncController { await this.gitService.gitCommit(); } + private notifyUserAboutBackup(): void { + new Notice("Successfully backed up vault!"); + + logger.success("Created vault backup."); + } + private notifyUserAboutConflicts(): void { new Notice("Your local and remote repositories had conflicting changes."); new Notice("Please fix the changes and then click the sync button again.");