Skip to content

Commit

Permalink
fix: properly disable auto pull
Browse files Browse the repository at this point in the history
close #816
  • Loading branch information
Vinzent03 committed Nov 24, 2024
1 parent 1a788b0 commit f8464e6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ export default class ObsidianGit extends Plugin {
this.branchBar?.remove();
this.statusBar?.remove();
this.gitManager.unload();
this.promiseQueue.clear();

for (const interval of this.intervalsToClear) {
window.clearInterval(interval);
Expand Down Expand Up @@ -664,7 +665,7 @@ export default class ObsidianGit extends Plugin {
return;
}
if (!filesUpdated) {
this.displayMessage("Everything is up-to-date");
this.displayMessage("Pull: Everything is up-to-date");
}

if (this.gitManager instanceof SimpleGit) {
Expand Down
4 changes: 4 additions & 0 deletions src/promiseQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@ export class PromiseQueue {
});
}
}

clear() {
this.tasks = [];
}
}
4 changes: 2 additions & 2 deletions src/setting/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ export class ObsidianGitSettingsTab extends PluginSettingTab {
Number(value);
await plugin.saveSettings();

plugin.automaticsManager.reload("push");
if (plugin.settings.autoPushInterval > 0) {
plugin.automaticsManager.reload("push");
new Notice(
`Automatic push enabled! Every ${formatMinutes(
plugin.settings.autoPushInterval
Expand Down Expand Up @@ -216,8 +216,8 @@ export class ObsidianGitSettingsTab extends PluginSettingTab {
Number(value);
await plugin.saveSettings();

plugin.automaticsManager.reload("pull");
if (plugin.settings.autoPullInterval > 0) {
plugin.automaticsManager.reload("pull");
new Notice(
`Automatic pull enabled! Every ${formatMinutes(
plugin.settings.autoPullInterval
Expand Down

0 comments on commit f8464e6

Please sign in to comment.