fix: the color mode button must not reset the primary color

pull/2522/head
William Grant 3 years ago
parent cf8a66a82b
commit 99ff6243ed

@ -73,9 +73,11 @@ const Section = (props: { type: SectionType }) => {
? currentTheme.replace('light', 'dark') ? currentTheme.replace('light', 'dark')
: currentTheme.replace('dark', 'light')) as ThemeStateType; : currentTheme.replace('dark', 'light')) as ThemeStateType;
// We want to persist the primary color when using the color mode button
await switchThemeTo({ await switchThemeTo({
theme: newTheme, theme: newTheme,
mainWindow: true, mainWindow: true,
usePrimaryColor: true,
dispatch, dispatch,
}); });
} else if (type === SectionType.PathIndicator) { } else if (type === SectionType.PathIndicator) {

@ -3,7 +3,6 @@ import { COLORS, THEMES } from './constants/colors';
import { ThemeColorVariables } from './variableColors'; import { ThemeColorVariables } from './variableColors';
const classicDark: ThemeColorVariables = { const classicDark: ThemeColorVariables = {
'--primary-color': THEMES.CLASSIC_DARK.PRIMARY,
'--danger-color': THEMES.CLASSIC_DARK.DANGER, '--danger-color': THEMES.CLASSIC_DARK.DANGER,
'--disabled-color': THEMES.CLASSIC_DARK.DISABLED, '--disabled-color': THEMES.CLASSIC_DARK.DISABLED,

@ -3,7 +3,6 @@ import { COLORS, THEMES } from './constants/colors';
import { ThemeColorVariables } from './variableColors'; import { ThemeColorVariables } from './variableColors';
const classicLight: ThemeColorVariables = { const classicLight: ThemeColorVariables = {
'--primary-color': THEMES.CLASSIC_LIGHT.PRIMARY,
'--danger-color': THEMES.CLASSIC_LIGHT.DANGER, '--danger-color': THEMES.CLASSIC_LIGHT.DANGER,
'--disabled-color': THEMES.CLASSIC_LIGHT.DISABLED, '--disabled-color': THEMES.CLASSIC_LIGHT.DISABLED,

@ -3,7 +3,6 @@ import { COLORS, THEMES } from './constants/colors';
import { ThemeColorVariables } from './variableColors'; import { ThemeColorVariables } from './variableColors';
const oceanDark: ThemeColorVariables = { const oceanDark: ThemeColorVariables = {
'--primary-color': THEMES.OCEAN_DARK.PRIMARY,
'--danger-color': THEMES.OCEAN_DARK.DANGER, '--danger-color': THEMES.OCEAN_DARK.DANGER,
'--disabled-color': THEMES.OCEAN_DARK.DISABLED, '--disabled-color': THEMES.OCEAN_DARK.DISABLED,

@ -3,7 +3,6 @@ import { COLORS, THEMES } from './constants/colors';
import { ThemeColorVariables } from './variableColors'; import { ThemeColorVariables } from './variableColors';
const oceanLight: ThemeColorVariables = { const oceanLight: ThemeColorVariables = {
'--primary-color': THEMES.OCEAN_LIGHT.PRIMARY,
'--danger-color': THEMES.OCEAN_LIGHT.DANGER, '--danger-color': THEMES.OCEAN_LIGHT.DANGER,
'--disabled-color': THEMES.OCEAN_LIGHT.DISABLED, '--disabled-color': THEMES.OCEAN_LIGHT.DISABLED,

@ -1,6 +1,5 @@
// Default Theme should be Classic Dark // Default Theme should be Classic Dark
export type ThemeColorVariables = { export type ThemeColorVariables = {
'--primary-color': string;
'--danger-color': string; '--danger-color': string;
'--disabled-color': string; '--disabled-color': string;

Loading…
Cancel
Save