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.");