diff --git a/src/client/web/src/components/__test__/pane_login.test.tsx b/src/client/web/src/components/__test__/pane_login.test.tsx index 8429c08..f0f50c4 100644 --- a/src/client/web/src/components/__test__/pane_login.test.tsx +++ b/src/client/web/src/components/__test__/pane_login.test.tsx @@ -70,6 +70,16 @@ describe("Login", () => { downloadSpeedLimit: 3, }, captchaID: "", + preferences: { + bg: { + url: "bgUrl", + repeat: "bgRepeat", + position: "bgPosition", + align: "bgAlign", + }, + cssURL: "cssURL", + lanPackURL: "lanPackURL", + }, }); // panes diff --git a/src/client/web/src/components/__test__/state_mgr.test.tsx b/src/client/web/src/components/__test__/state_mgr.test.tsx index beb28a7..5c344a3 100644 --- a/src/client/web/src/components/__test__/state_mgr.test.tsx +++ b/src/client/web/src/components/__test__/state_mgr.test.tsx @@ -82,6 +82,16 @@ describe("State Manager", () => { }, authed: true, captchaID: "", + preferences: { + bg: { + url: "bgUrl", + repeat: "bgRepeat", + position: "bgPosition", + align: "bgAlign", + }, + cssURL: "cssURL", + lanPackURL: "lanPackURL", + }, }); // admin @@ -177,6 +187,16 @@ describe("State Manager", () => { usedSpace: mockSelfResp.data.usedSpace, authed: false, captchaID: "", + preferences: { + bg: { + url: "bgUrl", + repeat: "bgRepeat", + position: "bgPosition", + align: "bgAlign", + }, + cssURL: "cssURL", + lanPackURL: "lanPackURL", + }, }); // admin diff --git a/src/client/web/src/components/core_state.ts b/src/client/web/src/components/core_state.ts index d9d41c0..b7c5236 100644 --- a/src/client/web/src/components/core_state.ts +++ b/src/client/web/src/components/core_state.ts @@ -24,8 +24,6 @@ export interface UIProps { position: string; align: string; }; - cssURL: string; - lanPackURL: string; } export interface ICoreState { browser: BrowserProps; @@ -70,6 +68,16 @@ export function initState(): ICoreState { }, authed: false, captchaID: "", + preferences: { + bg: { + url: "", + repeat: "", + position: "", + align: "", + }, + cssURL: "", + lanPackURL: "", + } }, admin: { users: Map(), @@ -89,8 +97,6 @@ export function initState(): ICoreState { position: "", align: "", }, - cssURL: "", - lanPackURL: "", }, }; } diff --git a/src/client/web/src/components/pane_login.tsx b/src/client/web/src/components/pane_login.tsx index c09329f..688dd20 100644 --- a/src/client/web/src/components/pane_login.tsx +++ b/src/client/web/src/components/pane_login.tsx @@ -5,7 +5,7 @@ import { ICoreState, MsgProps } from "./core_state"; import { Flexbox } from "./layout/flexbox"; import { updater } from "./state_updater"; import { alertMsg } from "../common/env"; -import { Quota } from "../client"; +import { Quota, Preferences } from "../client"; export interface LoginProps { userID: string; @@ -15,6 +15,7 @@ export interface LoginProps { quota: Quota; authed: boolean; captchaID: string; + preferences: Preferences; } export interface Props { diff --git a/src/client/web/src/components/state_updater.ts b/src/client/web/src/components/state_updater.ts index c17359b..c4e6780 100644 --- a/src/client/web/src/components/state_updater.ts +++ b/src/client/web/src/components/state_updater.ts @@ -387,9 +387,7 @@ export class Updater { this.props.login.userRole = resp.data.role; this.props.login.usedSpace = resp.data.usedSpace; this.props.login.quota = resp.data.quota; - this.props.ui.bg = resp.data.preferences.bg; - this.props.ui.cssURL = resp.data.preferences.cssURL; - this.props.ui.lanPackURL = resp.data.preferences.lanPackURL; + this.props.login.preferences = resp.data.preferences; return true; } this.resetUser();