diff --git a/src/client/web/src/components/panel_files.tsx b/src/client/web/src/components/panel_files.tsx index dedb594..7589af6 100644 --- a/src/client/web/src/components/panel_files.tsx +++ b/src/client/web/src/components/panel_files.tsx @@ -541,7 +541,7 @@ export class FilesPanel extends React.Component { this.select(item.name)} className="float-l"> {isSelected ? getIcon("RiCheckboxFill", "1.8rem", "cyan0") - : getIcon("RiCheckboxBlankFill", "1.8rem", "grey1")} + : getIcon("RiCheckboxBlankFill", "1.8rem", "black1")} ) : ( @@ -550,13 +550,13 @@ export class FilesPanel extends React.Component { onClick={() => this.toggleDetail(item.name)} className="float-l" > - {getIcon("RiInformationFill", "1.8rem", "grey1")} + {getIcon("RiInformationFill", "1.8rem", "black1")} this.select(item.name)} className="float-l"> {isSelected ? getIcon("RiCheckboxFill", "1.8rem", "cyan0") - : getIcon("RiCheckboxBlankFill", "1.8rem", "grey1")} + : getIcon("RiCheckboxBlankFill", "1.8rem", "black1")} ); diff --git a/src/client/web/src/components/state_updater.ts b/src/client/web/src/components/state_updater.ts index c62b851..8bf959b 100644 --- a/src/client/web/src/components/state_updater.ts +++ b/src/client/web/src/components/state_updater.ts @@ -413,8 +413,11 @@ export class Updater { syncCwd = async (): Promise => { if (this.props.filesInfo.dirPath.size !== 0) { return this.setItems(this.props.filesInfo.dirPath); + } else if (this.props.login.authed) { + return this.setHomeItems(); } - return this.setHomeItems(); + // cwd will not be synced if the user is not authned and without sharing mode + return ""; }; initCwd = async (params: URLSearchParams): Promise => { @@ -445,18 +448,26 @@ export class Updater { return isAuthedStatus; } - const getCapStatus = await this.getCaptchaID(); - if (getCapStatus !== "") { - return getCapStatus; - } - const selfStatuses = await Promise.all([this.self(), this.initCwd(params)]); if (selfStatuses.join("") !== "") { return selfStatuses.join(";"); } + const getCapStatus = await this.getCaptchaID(); + if (getCapStatus !== "") { + return getCapStatus; + } + this.initUITree(); + const isInSharingMode = this.props.ui.control.controls.get(sharingCtrl); + if ( + this.props.login.userRole === roleVisitor && + isInSharingMode !== ctrlOn + ) { + return this.initStateForVisitor(); + } + const cwdStatus = await this.syncCwd(); if (cwdStatus !== "") { return cwdStatus; @@ -472,6 +483,7 @@ export class Updater { if (this.props.login.userRole === roleAdmin) { return this.initStateForAdmin(); } else if (this.props.login.userRole === roleVisitor) { + // visitor under sharing mode return this.initStateForVisitor(); } return this.initStateForAuthedUser(); @@ -514,6 +526,7 @@ export class Updater { this.props.login.preferences = resp.data.preferences; return ""; } else if (resp.status === 401) { + this.resetUser(); return ""; }