diff --git a/src/client/web/src/components/panel_uploadings.tsx b/src/client/web/src/components/panel_uploadings.tsx index 8d448b5..b1d6075 100644 --- a/src/client/web/src/components/panel_uploadings.tsx +++ b/src/client/web/src/components/panel_uploadings.tsx @@ -67,7 +67,6 @@ export class UploadingsPanel extends React.Component { } const statuses = await Promise.all([ - updater().refreshUploadings(), updater().self(), ]); if (statuses.join("") !== "") { diff --git a/src/client/web/src/components/state_updater.ts b/src/client/web/src/components/state_updater.ts index 0a6fbde..80c2b76 100644 --- a/src/client/web/src/components/state_updater.ts +++ b/src/client/web/src/components/state_updater.ts @@ -71,6 +71,7 @@ export class Updater { this.props.filesInfo.dirPath.join("/"), file.name ); + const status = Up().add(file, filePath); if (status !== "") { return status; @@ -87,6 +88,8 @@ export class Updater { return status; } + this.setUploads(Up().list()); + const resp = await this.filesClient.deleteUploading(filePath); return resp.status === 200 ? "" : errServer; }; @@ -534,11 +537,6 @@ export class Updater { }; initAuth = async (): Promise => { - const getCapStatus = await this.getCaptchaID(); - if (getCapStatus !== "") { - return getCapStatus; - } - const isAuthedStatus = await this.syncIsAuthed(); if (isAuthedStatus !== "") { return isAuthedStatus; @@ -554,6 +552,11 @@ export class Updater { initAll = async (params: URLSearchParams): Promise => { const paramMap = await this.initParams(params); + const getCapStatus = await this.getCaptchaID(); + if (getCapStatus !== "") { + return getCapStatus; + } + const authStatus = await this.initAuth(); if (authStatus !== "") { return authStatus; @@ -638,7 +641,7 @@ export class Updater { this.props.login.quota = resp.data.quota; this.props.login.preferences = resp.data.preferences; return ""; - } else if (resp.status === 401) { + } else if (resp.status === 403) { this.resetUser(); return ""; } @@ -746,7 +749,7 @@ export class Updater { const resp = await this.usersClient.isAuthed(); if (resp.status !== 200) { this.resetUser(); - return resp.status === 401 ? "" : errServer; + return resp.status === 403 ? "" : errServer; } this.props.login.authed = true; return "";