Skip to content

Commit

Permalink
fix improve loadingEffect() usage
Browse files Browse the repository at this point in the history
  • Loading branch information
k2s committed Aug 7, 2023
1 parent 3a84e09 commit 736abfb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/helper/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,16 @@ export const checkIsRemoteSynced = async () => {
export const checkStatusWithDebounce = debounce(async (perform = true) => {
if (perform) {
if (isEnabledInThisWindow()) {
const waitFor = [checkStatus()];
if (gitConfiguration.hasRemote) {
// TODO this should be reworked
waitFor.push(checkIsRemoteSynced());
}
await Promise.all(waitFor);
logDebug("checkStatusWithDebounce = START");
await loadingEffect(async () => {
const waitFor = [checkStatus()];
if (gitConfiguration.hasRemote) {
// TODO this should be reworked
waitFor.push(checkIsRemoteSynced());
}
await Promise.all(waitFor);
});
logDebug("checkStatusWithDebounce = END");
}
} else {
logDebug("clear checkStatusWithDebounce");
Expand Down
1 change: 1 addition & 0 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ if (isDevelopment) {
// noChange void
// changed commit push
if (logseq.settings?.autoPush) {
logInfo("autoPush is enabled, saving...");
operations.sync();
}
}
Expand Down

0 comments on commit 736abfb

Please sign in to comment.