diff --git a/password_preload.js b/password_preload.js index 7134be51a..18e3aad60 100644 --- a/password_preload.js +++ b/password_preload.js @@ -13,6 +13,7 @@ window.ReactDOM = require('react-dom'); // If the app is locked we can't access the database to check the theme. window.theme = 'classic-dark'; +window.primaryColor = 'green'; window.i18n = i18n.setupi18n(locale, localeMessages); window.getEnvironment = () => config.environment; diff --git a/stylesheets/_session.scss b/stylesheets/_session.scss index 370129e7a..4da5001b7 100644 --- a/stylesheets/_session.scss +++ b/stylesheets/_session.scss @@ -153,6 +153,7 @@ textarea { // To limit messages with things forcing them wider, like long attachment names max-width: 100%; align-items: center; + border-radius: var(--border-radius-message-box); } label { user-select: none; diff --git a/ts/components/SessionPasswordPrompt.tsx b/ts/components/SessionPasswordPrompt.tsx index 66f5bf073..ca9ffd770 100644 --- a/ts/components/SessionPasswordPrompt.tsx +++ b/ts/components/SessionPasswordPrompt.tsx @@ -11,6 +11,7 @@ import { ToastUtils } from '../session/utils'; import { isString } from 'lodash'; import { SessionToastContainer } from './SessionToastContainer'; import { SessionWrapperModal } from './SessionWrapperModal'; +import { switchPrimaryColorTo } from '../themes/switchPrimaryColor'; interface State { errorCount: number; @@ -199,6 +200,9 @@ export const SessionPasswordPrompt = () => { theme: (window as any).theme, }); } + if ((window as any).primaryColor) { + void switchPrimaryColorTo((window as any).primaryColor); + } }, []); return ( diff --git a/ts/themes/switchPrimaryColor.tsx b/ts/themes/switchPrimaryColor.tsx index 7b07460f9..6a66d5fff 100644 --- a/ts/themes/switchPrimaryColor.tsx +++ b/ts/themes/switchPrimaryColor.tsx @@ -9,7 +9,9 @@ export function findPrimaryColorId(hexCode: string): PrimaryColorStateType | und } export async function switchPrimaryColorTo(color: PrimaryColorStateType, dispatch?: Dispatch) { - await window.Events.setPrimaryColorSetting(color); + if (window.Events) { + await window.Events.setPrimaryColorSetting(color); + } document.documentElement.style.setProperty( '--primary-color',