Browse Source

fix: setTheme make theme parameter optional

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/3390/head
mertmit 2 years ago
parent
commit
dbcb4a9611
  1. 2
      packages/nc-gui-v2/composables/useProject.ts
  2. 2
      packages/nc-gui-v2/composables/useTheme/index.ts

2
packages/nc-gui-v2/composables/useProject.ts

@ -112,7 +112,7 @@ const [setup, use] = useInjectionState((_projectId?: MaybeRef<string>) => {
() => route.params,
(v) => {
if (!v?.projectId) {
setTheme({})
setTheme()
}
},
)

2
packages/nc-gui-v2/composables/useTheme/index.ts

@ -22,7 +22,7 @@ const [setup, use] = useInjectionState((config?: Partial<ThemeConfig>) => {
setTheme(config ?? currentTheme.value)
/** set theme (persists in localstorage) */
function setTheme(theme: Partial<ThemeConfig>) {
function setTheme(theme?: Partial<ThemeConfig>) {
const themePrimary = theme?.primaryColor ? tinycolor(theme.primaryColor) : tinycolor(themeV2Colors['royal-blue'].DEFAULT)
const themeAccent = theme?.accentColor ? tinycolor(theme.accentColor) : tinycolor(themeV2Colors.pink['500'])

Loading…
Cancel
Save