Remove indentation config from actions, reducers, and constants
This commit is contained in:
parent
ddb93e6c8d
commit
d1ce054abf
3 changed files with 0 additions and 72 deletions
|
@ -13,14 +13,6 @@ export const OPEN_PREFERENCES = 'OPEN_PREFERENCES';
|
|||
export const CLOSE_PREFERENCES = 'CLOSE_PREFERENCES';
|
||||
export const SET_FONT_SIZE = 'SET_FONT_SIZE';
|
||||
|
||||
export const INCREASE_INDENTATION = 'INCREASE_INDENTATION';
|
||||
export const DECREASE_INDENTATION = 'DECREASE_INDENTATION';
|
||||
export const UPDATE_INDENTATION = 'UPDATE_INDENTATION';
|
||||
export const SET_INDENTATION = 'SET_INDENTATION';
|
||||
|
||||
export const INDENT_WITH_SPACE = 'INDENT_WITH_SPACE';
|
||||
export const INDENT_WITH_TAB = 'INDENT_WITH_TAB';
|
||||
|
||||
export const AUTH_USER = 'AUTH_USER';
|
||||
export const UNAUTH_USER = 'UNAUTH_USER';
|
||||
export const AUTH_ERROR = 'AUTH_ERROR';
|
||||
|
|
|
@ -32,58 +32,6 @@ export function setFontSize(value) {
|
|||
};
|
||||
}
|
||||
|
||||
export function setIndentation(value) {
|
||||
return (dispatch, getState) => {
|
||||
dispatch({
|
||||
type: ActionTypes.SET_INDENTATION,
|
||||
value
|
||||
});
|
||||
const state = getState();
|
||||
if (state.user.authenticated) {
|
||||
const formParams = {
|
||||
preferences: {
|
||||
indentationAmount: value
|
||||
}
|
||||
};
|
||||
updatePreferences(formParams, dispatch);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function indentWithTab() {
|
||||
return (dispatch, getState) => {
|
||||
dispatch({
|
||||
type: ActionTypes.INDENT_WITH_TAB
|
||||
});
|
||||
const state = getState();
|
||||
if (state.user.authenticated) {
|
||||
const formParams = {
|
||||
preferences: {
|
||||
isTabIndent: true
|
||||
}
|
||||
};
|
||||
updatePreferences(formParams, dispatch);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function indentWithSpace() {
|
||||
return (dispatch, getState) => {
|
||||
dispatch({
|
||||
type: ActionTypes.INDENT_WITH_SPACE
|
||||
});
|
||||
const state = getState();
|
||||
if (state.user.authenticated) {
|
||||
const formParams = {
|
||||
preferences: {
|
||||
isTabIndent: false
|
||||
}
|
||||
};
|
||||
updatePreferences(formParams, dispatch);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function setAutosave(value) {
|
||||
return (dispatch, getState) => {
|
||||
dispatch({
|
||||
|
|
|
@ -2,8 +2,6 @@ import * as ActionTypes from '../../../constants';
|
|||
|
||||
const initialState = {
|
||||
fontSize: 18,
|
||||
indentationAmount: 2,
|
||||
isTabIndent: true,
|
||||
autosave: true,
|
||||
lintWarning: false,
|
||||
textOutput: false,
|
||||
|
@ -17,16 +15,6 @@ const preferences = (state = initialState, action) => {
|
|||
switch (action.type) {
|
||||
case ActionTypes.SET_FONT_SIZE:
|
||||
return Object.assign({}, state, { fontSize: action.value });
|
||||
case ActionTypes.SET_INDENTATION:
|
||||
return Object.assign({}, state, { indentationAmount: action.value });
|
||||
case ActionTypes.INDENT_WITH_TAB:
|
||||
return Object.assign({}, state, {
|
||||
isTabIndent: true
|
||||
});
|
||||
case ActionTypes.INDENT_WITH_SPACE:
|
||||
return Object.assign({}, state, {
|
||||
isTabIndent: false
|
||||
});
|
||||
case ActionTypes.SET_AUTOSAVE:
|
||||
return Object.assign({}, state, { autosave: action.value });
|
||||
case ActionTypes.SET_LINT_WARNING:
|
||||
|
|
Loading…
Reference in a new issue