Skip to content

Commit

Permalink
fix(cloudstorage): refresh list on file upload complete (#549)
Browse files Browse the repository at this point in the history
  • Loading branch information
crimx committed Apr 16, 2021
1 parent a6514b1 commit e09113b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions desktop/renderer-app/src/pages/CloudStoragePage/store.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,11 @@ export class CloudStorageStore extends CloudStorageStoreBase {
}

const disposer = reaction(
() => this.sortedUploadTasks.length,
() => {
this.refreshFilesNowDebounced();
() => this.uploadTaskManager.uploading.length,
(currLen, prevLen) => {
if (currLen < prevLen) {
this.refreshFilesNowDebounced();
}
},
);

Expand Down Expand Up @@ -333,7 +335,9 @@ export class CloudStorageStore extends CloudStorageStoreBase {

private refreshFilesNowDebounced(timeout = 800): void {
this.clearRefreshFilesNowTimeout();
console.log("[cloud storage]: start now refresh");
this._refreshFilesNowTimeout = window.setTimeout(() => {
console.log("[cloud storage]: start now refresh!!!!!!!!!");
this.refreshFiles();
}, timeout);
}
Expand Down

0 comments on commit e09113b

Please sign in to comment.