Skip to content

Commit 26dee2e

Browse files
committed
feat(pendingView): Make it silent for auto cases.
1 parent 114777b commit 26dee2e

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

src/components/CheckSettingsModal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export class CheckSettingsModal extends Modal {
103103
realVal > 0
104104
) {
105105
const intervalID = window.setInterval(() => {
106-
this.plugin.pendingView();
106+
this.plugin.pendingView(true);
107107
}, realVal);
108108
this.plugin.autoCheckIntervalID = intervalID;
109109
this.plugin.registerInterval(intervalID);

src/main.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -884,14 +884,16 @@ export default class InvioPlugin extends Plugin {
884884
}
885885
}
886886

887-
async pendingView() {
887+
async pendingView(silent?: boolean) {
888888
if (this.syncStatus !== 'idle') {
889889
await this.doSyncRunAbort(8000);
890890
}
891891
const { toRemoteFiles, toLocalFiles } = await this.syncRun('pre') || {};
892892
log.info('toughed files: ', toRemoteFiles, toLocalFiles);
893893
const touched = [ ...(toRemoteFiles || []), ...(toLocalFiles || []) ]
894-
await StatsView.activateStatsView(this);
894+
if (!silent) {
895+
await StatsView.activateStatsView(this);
896+
}
895897
const view = StatsView.getStatsView(this, 'PendingStats');
896898
view?.setStatsType('PendingStats')
897899
const fileMap: Record<string, FileOrFolderMixedState> = {};
@@ -986,7 +988,7 @@ export default class InvioPlugin extends Plugin {
986988
} else {
987989
Utils.mockLocaleFile(this)
988990
}
989-
this.pendingView()
991+
this.pendingView(true)
990992
})
991993
} else {
992994
new Notice(
@@ -1582,7 +1584,7 @@ export default class InvioPlugin extends Plugin {
15821584
) {
15831585
this.app.workspace.onLayoutReady(() => {
15841586
const intervalID = window.setInterval(() => {
1585-
this.pendingView()
1587+
this.pendingView(true)
15861588
}, this.settings.autoCheckEveryMilliseconds);
15871589
this.autoCheckIntervalID = intervalID;
15881590
this.registerInterval(intervalID);
@@ -1598,7 +1600,7 @@ export default class InvioPlugin extends Plugin {
15981600
) {
15991601
this.app.workspace.onLayoutReady(() => {
16001602
window.setTimeout(() => {
1601-
this.pendingView()
1603+
this.pendingView(true)
16021604
}, this.settings.initCheckAfterMilliseconds);
16031605
});
16041606
}

src/settings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ export class InvioSettingTab extends PluginSettingTab {
970970
realVal > 0
971971
) {
972972
const intervalID = window.setInterval(() => {
973-
this.plugin.pendingView();
973+
this.plugin.pendingView(true);
974974
}, realVal);
975975
this.plugin.autoCheckIntervalID = intervalID;
976976
this.plugin.registerInterval(intervalID);

src/statsView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class StatsView extends ItemView {
5656
});
5757

5858
plugin.app.workspace.revealLeaf(
59-
plugin.app.workspace.getLeavesOfType(VIEW_TYPE_STATS)[0]
59+
plugin.app.workspace.getLeavesOfType(VIEW_TYPE_STATS)[0]
6060
);
6161
}
6262

0 commit comments

Comments
 (0)