From 8c95f85eb1f5296e469c99fe93ed5bdc3854aa45 Mon Sep 17 00:00:00 2001 From: hexxa Date: Sun, 17 Oct 2021 20:23:56 +0800 Subject: [PATCH] feat(fe/root_frame): get bg config from users and site settings --- src/client/web/src/components/root_frame.tsx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/client/web/src/components/root_frame.tsx b/src/client/web/src/components/root_frame.tsx index f3ce692..a03a4ce 100644 --- a/src/client/web/src/components/root_frame.tsx +++ b/src/client/web/src/components/root_frame.tsx @@ -25,12 +25,18 @@ export class RootFrame extends React.Component { } render() { - const bgStyle = - this.props.ui.bg.url !== "" - ? { - background: `url("${this.props.ui.bg.url}") ${this.props.ui.bg.repeat} ${this.props.ui.bg.position} ${this.props.ui.bg.align}`, - } - : {}; + let bgStyle = undefined; + if (this.props.login.preferences.bg.url !== "") { + bgStyle = { + background: `url("${this.props.login.preferences.bg.url}") ${this.props.login.preferences.bg.repeat} ${this.props.login.preferences.bg.position} ${this.props.login.preferences.bg.align}`, + }; + } else if (this.props.ui.bg.url !== "") { + bgStyle = { + background: `url("${this.props.ui.bg.url}") ${this.props.ui.bg.repeat} ${this.props.ui.bg.position} ${this.props.ui.bg.align}`, + }; + } else { + bgStyle = {}; + } const showBrowser = this.props.login.userRole === roleVisitor && !this.props.browser.isSharing