fix(ui/browser): only refresh item list after one uploading is finished

This commit is contained in:
hexxa 2021-08-27 17:16:44 +08:00 committed by Hexxa
parent 565c7324ef
commit 8fa9cd2b0d
2 changed files with 13 additions and 6 deletions

View file

@ -204,13 +204,17 @@ export class Browser extends React.Component<Props, State, {}> {
}); });
}; };
updateProgress = (infos: Map<string, UploadEntry>) => { updateProgress = (infos: Map<string, UploadEntry>, refresh: boolean) => {
updater().setUploadings(infos); updater().setUploadings(infos);
updater() if (refresh) {
.setItems(this.props.browser.dirPath) updater()
.then(() => { .setItems(this.props.browser.dirPath)
this.update(updater().updateBrowser); .then(() => {
}); this.update(updater().updateBrowser);
});
} else {
this.update(updater().updateBrowser);
}
}; };
select = (itemName: string) => { select = (itemName: string) => {

View file

@ -104,6 +104,9 @@ export class StateMgr extends React.Component<Props, State, {}> {
this.update(updater().updateLogin); this.update(updater().updateLogin);
this.update(updater().updatePanes); this.update(updater().updatePanes);
this.update(updater().updateAdmin); this.update(updater().updateAdmin);
updater().initLan();
this.update(updater().updateMsg);
}); });
}; };