Skip to content

Commit 71d2a59

Browse files
committed
fix: lastUpate gets changed when no changes are detected
1 parent ac315f0 commit 71d2a59

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

main.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ export default class ObsidianGit extends Plugin {
150150
if (changedFiles.length !== 0) {
151151
await this.add();
152152
await this.commit();
153+
this.lastUpdate = Date.now();
153154
this.displayMessage(`Committed ${changedFiles.length} files`);
154155
} else {
155156
this.displayMessage("No changes to commit");
@@ -175,14 +176,12 @@ export default class ObsidianGit extends Plugin {
175176
}
176177
}
177178
await this.push();
179+
this.lastUpdate = Date.now();
178180
this.displayMessage(`Pushed ${allChangedFiles.length} files to remote`);
179181
} else {
180182
this.displayMessage("No changes to push");
181-
this.setState(PluginState.idle);
182183
}
183184
}
184-
185-
this.lastUpdate = Date.now();
186185
this.setState(PluginState.idle);
187186
}
188187

0 commit comments

Comments
 (0)