Skip to content

Commit

Permalink
fix: assignment to constant variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Linkontoask committed Dec 25, 2020
1 parent b39629d commit 9152453
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/pages/header/component/setting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ import { useThemeColor } from '@/hooks'

const { VUE_APP_PLATFORM } = process.env

const setColor = (value: string) => {
const setColor = (baseColor: string) => {
const color = {
'base-color': value.toLocaleLowerCase(),
'base-color-lighten': shade(value, 0.1),
'base-color-darken': shade(value, -0.1),
'normal-theme-text': shade(value, 0.1),
'primary-theme-text': value.toLocaleLowerCase(),
'base-color-background': shade(value, 0.4),
'secondary-theme-text': shade(value, 0.2)
'base-color': baseColor.toLocaleLowerCase(),
'base-color-lighten': shade(baseColor, 0.1),
'base-color-darken': shade(baseColor, -0.1),
'normal-theme-text': shade(baseColor, 0.1),
'primary-theme-text': baseColor.toLocaleLowerCase(),
'base-color-background': shade(baseColor, 0.4),
'secondary-theme-text': shade(baseColor, 0.2)
}

for (const [key, value] of Object.entries(color)) {
Expand All @@ -27,7 +27,10 @@ const setColor = (value: string) => {

if (VUE_APP_PLATFORM === Platform.ELECTRON) {
importIpc().then(event => {
event.sendAsyncIpcRendererEvent(MiddlewareView.UPDATE_THEME_COLOR, value)
event.sendAsyncIpcRendererEvent(
MiddlewareView.UPDATE_THEME_COLOR,
baseColor
)
})
}
}
Expand Down

0 comments on commit 9152453

Please sign in to comment.