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 { takeEvery } from 'redux-saga/effects';
|
||||||
import store from 'store';
|
import store from 'store';
|
||||||
import { isEmpty } from 'lodash';
|
|
||||||
|
|
||||||
const themeKey = 'fcc-theme';
|
const themeKey = 'fcc-theme';
|
||||||
const defaultTheme = 'default';
|
const defaultTheme = 'default';
|
||||||
const nightTheme = 'night';
|
const nightTheme = 'night';
|
||||||
|
|
||||||
function setTheme(currentTheme = nightTheme, theme = nightTheme) {
|
function setTheme(currentTheme = defaultTheme, theme) {
|
||||||
if (currentTheme !== theme) {
|
if (currentTheme !== theme) {
|
||||||
store.set(themeKey, theme);
|
store.set(themeKey, theme);
|
||||||
}
|
}
|
||||||
@ -18,9 +17,9 @@ function setTheme(currentTheme = nightTheme, theme = nightTheme) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function* updateLocalThemeSaga({ payload: { user, theme } }) {
|
function* updateLocalThemeSaga({ payload: { user, theme } }) {
|
||||||
const currentTheme = store.get(themeKey) || nightTheme;
|
const currentTheme = store.get(themeKey) || defaultTheme;
|
||||||
if (!isEmpty(user)) {
|
if (user) {
|
||||||
const { theme = nightTheme } = user;
|
const { theme = defaultTheme } = user;
|
||||||
return setTheme(currentTheme, theme);
|
return setTheme(currentTheme, theme);
|
||||||
}
|
}
|
||||||
if (theme) {
|
if (theme) {
|
||||||
|
Reference in New Issue
Block a user