diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2022-11-17 09:31:07 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2022-11-17 09:31:07 +0900 |
| commit | d5aee2ea58a16e0cf65213fab9e46192882feba9 (patch) | |
| tree | 037be7ad7b26abf647faa0f4ee6a6a96ba37fa95 /packages/client/src/scripts/theme.ts | |
| parent | fix typo on CleanRemoteFilesProcessorService (#9171) (diff) | |
| download | sharkey-d5aee2ea58a16e0cf65213fab9e46192882feba9.tar.gz sharkey-d5aee2ea58a16e0cf65213fab9e46192882feba9.tar.bz2 sharkey-d5aee2ea58a16e0cf65213fab9e46192882feba9.zip | |
improve performance
Diffstat (limited to 'packages/client/src/scripts/theme.ts')
| -rw-r--r-- | packages/client/src/scripts/theme.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/client/src/scripts/theme.ts b/packages/client/src/scripts/theme.ts index 3f55d9ae86..62a2b9459a 100644 --- a/packages/client/src/scripts/theme.ts +++ b/packages/client/src/scripts/theme.ts @@ -13,6 +13,7 @@ export type Theme = { import lightTheme from '@/themes/_light.json5'; import darkTheme from '@/themes/_dark.json5'; +import { deepClone } from './clone'; export const themeProps = Object.keys(lightTheme.props).filter(key => !key.startsWith('X')); @@ -60,7 +61,7 @@ export function applyTheme(theme: Theme, persist = true) { const colorSchema = theme.base === 'dark' ? 'dark' : 'light'; // Deep copy - const _theme = JSON.parse(JSON.stringify(theme)); + const _theme = deepClone(theme); if (_theme.base) { const base = [lightTheme, darkTheme].find(x => x.id === _theme.base); |