Skip to content

Commit

Permalink
fix: lastUpate gets changed when no changes are detected
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinzent03 committed Mar 15, 2021
1 parent ac315f0 commit 71d2a59
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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);
}

Expand Down

0 comments on commit 71d2a59

Please sign in to comment.