Dark theme loading screen
This commit is contained in:
parent
af2c884c9f
commit
b30c7f9c46
7 changed files with 114 additions and 18 deletions
|
@ -29,6 +29,7 @@ import type { Receipt } from './types/Receipt';
|
|||
import { getTitleBarVisibility, TitleBarVisibility } from './types/Settings';
|
||||
import { SocketStatus } from './types/SocketStatus';
|
||||
import { DEFAULT_CONVERSATION_COLOR } from './types/Colors';
|
||||
import { ThemeType } from './types/Util';
|
||||
import { ChallengeHandler } from './challenge';
|
||||
import * as durations from './util/durations';
|
||||
import { explodePromise } from './util/explodePromise';
|
||||
|
@ -166,6 +167,13 @@ export async function cleanupSessionResets(): Promise<void> {
|
|||
}
|
||||
|
||||
export async function startApp(): Promise<void> {
|
||||
if (window.initialTheme === ThemeType.light) {
|
||||
document.body.classList.add('light-theme');
|
||||
}
|
||||
if (window.initialTheme === ThemeType.dark) {
|
||||
document.body.classList.add('dark-theme');
|
||||
}
|
||||
|
||||
const idleDetector = new IdleDetector();
|
||||
|
||||
await KeyboardLayout.initialize();
|
||||
|
|
|
@ -17,6 +17,7 @@ import type {
|
|||
const EPHEMERAL_NAME_MAP = new Map([
|
||||
['spellCheck', 'spell-check'],
|
||||
['systemTraySetting', 'system-tray-setting'],
|
||||
['themeSetting', 'theme-setting'],
|
||||
]);
|
||||
|
||||
type ResponseQueueEntry = Readonly<{
|
||||
|
@ -68,7 +69,9 @@ export class SettingsChannel {
|
|||
this.installSetting('readReceiptSetting', { setter: false });
|
||||
this.installSetting('typingIndicatorSetting', { setter: false });
|
||||
|
||||
this.installSetting('themeSetting');
|
||||
this.installSetting('themeSetting', {
|
||||
isEphemeral: true,
|
||||
});
|
||||
this.installSetting('hideMenuBar');
|
||||
this.installSetting('systemTraySetting', {
|
||||
isEphemeral: true,
|
||||
|
|
3
ts/window.d.ts
vendored
3
ts/window.d.ts
vendored
|
@ -29,7 +29,7 @@ import * as Curve from './Curve';
|
|||
import * as RemoteConfig from './RemoteConfig';
|
||||
import * as OS from './OS';
|
||||
import { getEnvironment } from './environment';
|
||||
import { LocalizerType } from './types/Util';
|
||||
import { LocalizerType, ThemeType } from './types/Util';
|
||||
import type { Receipt } from './types/Receipt';
|
||||
import { ConversationController } from './ConversationController';
|
||||
import { ReduxActions } from './state/types';
|
||||
|
@ -212,6 +212,7 @@ declare global {
|
|||
isAfterVersion: (version: string, anotherVersion: string) => boolean;
|
||||
isBeforeVersion: (version: string, anotherVersion: string) => boolean;
|
||||
isFullScreen: () => boolean;
|
||||
initialTheme?: ThemeType;
|
||||
libphonenumber: {
|
||||
util: {
|
||||
getRegionCodeForNumber: (number: string) => string;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue