diff --git a/client/src/redux/night-mode-saga.js b/client/src/redux/night-mode-saga.js index 5cc5fa6761..7723f06d99 100644 --- a/client/src/redux/night-mode-saga.js +++ b/client/src/redux/night-mode-saga.js @@ -2,13 +2,12 @@ import { takeEvery } from 'redux-saga/effects'; import store from 'store'; -import { isEmpty } from 'lodash'; const themeKey = 'fcc-theme'; const defaultTheme = 'default'; const nightTheme = 'night'; -function setTheme(currentTheme = nightTheme, theme = nightTheme) { +function setTheme(currentTheme = defaultTheme, theme) { if (currentTheme !== theme) { store.set(themeKey, theme); } @@ -18,9 +17,9 @@ function setTheme(currentTheme = nightTheme, theme = nightTheme) { } function* updateLocalThemeSaga({ payload: { user, theme } }) { - const currentTheme = store.get(themeKey) || nightTheme; - if (!isEmpty(user)) { - const { theme = nightTheme } = user; + const currentTheme = store.get(themeKey) || defaultTheme; + if (user) { + const { theme = defaultTheme } = user; return setTheme(currentTheme, theme); } if (theme) {