Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions client/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const SET_LINE_NUMBERS = 'SET_LINE_NUMBERS';
export const AUTH_USER = 'AUTH_USER';
export const UNAUTH_USER = 'UNAUTH_USER';
export const AUTH_ERROR = 'AUTH_ERROR';
export const THEME_KEY = 'THEME_KEY';

export const SETTINGS_UPDATED = 'SETTINGS_UPDATED';

Expand Down
4 changes: 3 additions & 1 deletion client/modules/IDE/reducers/preferences.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { THEME_KEY } from '../../../constants';
import * as ActionTypes from '../../../constants';

const initialState = {
Expand All @@ -8,7 +9,7 @@ const initialState = {
lintWarning: false,
textOutput: false,
gridOutput: false,
theme: 'light',
theme: localStorage.getItem(THEME_KEY) || 'light',
autorefresh: false,
language: 'en-US',
autocloseBracketsQuotes: true
Expand All @@ -31,6 +32,7 @@ const preferences = (state = initialState, action) => {
case ActionTypes.SET_PREFERENCES:
return action.preferences;
case ActionTypes.SET_THEME:
localStorage.setItem(THEME_KEY, action.value);
return Object.assign({}, state, { theme: action.value });
case ActionTypes.SET_AUTOREFRESH:
return Object.assign({}, state, { autorefresh: action.value });
Expand Down