From 71d2a59f1d5ea7f7fd08e77b1802a47d0aae3f46 Mon Sep 17 00:00:00 2001 From: Vinzent Date: Mon, 15 Mar 2021 15:36:58 +0100 Subject: [PATCH] fix: lastUpate gets changed when no changes are detected --- main.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main.ts b/main.ts index 40e13b3d..5043395e 100644 --- a/main.ts +++ b/main.ts @@ -150,6 +150,7 @@ export default class ObsidianGit extends Plugin { if (changedFiles.length !== 0) { await this.add(); await this.commit(); + this.lastUpdate = Date.now(); this.displayMessage(`Committed ${changedFiles.length} files`); } else { this.displayMessage("No changes to commit"); @@ -175,14 +176,12 @@ export default class ObsidianGit extends Plugin { } } await this.push(); + this.lastUpdate = Date.now(); this.displayMessage(`Pushed ${allChangedFiles.length} files to remote`); } else { this.displayMessage("No changes to push"); - this.setState(PluginState.idle); } } - - this.lastUpdate = Date.now(); this.setState(PluginState.idle); }