Skip to content

Commit

Permalink
feat: add notice when vault successfully backs up
Browse files Browse the repository at this point in the history
  • Loading branch information
mahyarmirrashed committed Jul 3, 2023
1 parent 9b70632 commit 104c154
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/controllers/syncController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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...");
Expand All @@ -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.");

Expand All @@ -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.");
Expand Down

0 comments on commit 104c154

Please sign in to comment.