revert: "fix: make night mode default for code blocks"
This reverts commit 5a38887af1
.
This commit is contained in:
committed by
mrugesh
parent
b40e069724
commit
39aa707533
@ -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) {
|
||||
|
Reference in New Issue
Block a user