fix: make cleaner defaults for switchThemeTo function

pull/2522/head
William Grant 3 years ago
parent b777d0bcd1
commit 8135c2a861

@ -38,8 +38,6 @@ export const AboutView = () => {
if ((window as any).theme) {
void switchThemeTo({
theme: (window as any).theme,
mainWindow: false,
resetPrimaryColor: false,
});
}
}, []);

@ -103,8 +103,6 @@ export const DebugLogView = () => {
if ((window as any).theme) {
void switchThemeTo({
theme: (window as any).theme,
mainWindow: false,
resetPrimaryColor: false,
});
}
}, []);

@ -194,8 +194,6 @@ export const SessionPasswordPrompt = () => {
if ((window as any).theme) {
void switchThemeTo({
theme: (window as any).theme,
mainWindow: false,
resetPrimaryColor: false,
});
}
}, []);

@ -164,7 +164,6 @@ const setupTheme = async () => {
await switchThemeTo({
theme,
mainWindow: true,
resetPrimaryColor: false,
dispatch: window?.inboxStore?.dispatch || undefined,
});

@ -8,13 +8,13 @@ import { findPrimaryColorId, switchPrimaryColorTo } from './switchPrimaryColor';
type SwitchThemeProps = {
theme: ThemeStateType;
mainWindow: boolean;
resetPrimaryColor: boolean;
mainWindow?: boolean;
resetPrimaryColor?: boolean;
dispatch?: Dispatch;
};
export async function switchThemeTo(props: SwitchThemeProps) {
const { theme, mainWindow = true, resetPrimaryColor = true, dispatch } = props;
const { theme, mainWindow, resetPrimaryColor, dispatch } = props;
let newTheme: ThemeStateType | null = null;
switch (theme) {

Loading…
Cancel
Save