2018-04-06 14:51:52 +01:00
|
|
|
import { createAction, handleActions } from 'redux-actions';
|
2018-09-21 17:30:16 +03:00
|
|
|
|
2018-09-27 14:19:03 +03:00
|
|
|
import { createTypes } from '../../../../utils/stateManagement';
|
2018-11-07 18:15:27 +00:00
|
|
|
|
2020-06-13 11:27:15 +02:00
|
|
|
import { createPoly } from '../../../../../utils/polyvinyl';
|
2018-04-06 14:51:52 +01:00
|
|
|
import challengeModalEpic from './challenge-modal-epic';
|
|
|
|
import completionEpic from './completion-epic';
|
2018-04-11 15:10:48 +01:00
|
|
|
import codeLockEpic from './code-lock-epic';
|
2018-05-08 00:29:45 +01:00
|
|
|
import createQuestionEpic from './create-question-epic';
|
2018-05-09 12:40:09 +01:00
|
|
|
import codeStorageEpic from './code-storage-epic';
|
2018-04-06 14:51:52 +01:00
|
|
|
|
2018-11-26 02:17:38 +03:00
|
|
|
import { createExecuteChallengeSaga } from './execute-challenge-saga';
|
2019-02-06 14:30:54 +03:00
|
|
|
import { createCurrentChallengeSaga } from './current-challenge-saga';
|
2019-02-08 17:33:05 +03:00
|
|
|
import { challengeTypes } from '../../../../utils/challengeTypes';
|
2019-09-03 08:38:19 +01:00
|
|
|
import { completedChallengesSelector } from '../../../redux';
|
2020-07-17 21:03:23 +02:00
|
|
|
import { isEmpty } from 'lodash';
|
2018-11-07 18:15:27 +00:00
|
|
|
|
2018-11-29 12:12:15 +00:00
|
|
|
export const ns = 'challenge';
|
2018-04-17 11:33:04 +01:00
|
|
|
export const backendNS = 'backendChallenge';
|
2018-04-06 14:51:52 +01:00
|
|
|
|
|
|
|
const initialState = {
|
2019-09-24 11:44:48 +02:00
|
|
|
canFocusEditor: true,
|
2018-04-06 14:51:52 +01:00
|
|
|
challengeFiles: {},
|
|
|
|
challengeMeta: {
|
2020-02-04 06:03:56 +01:00
|
|
|
superBlock: '',
|
2019-11-15 11:33:08 -06:00
|
|
|
block: '',
|
2018-04-06 14:51:52 +01:00
|
|
|
id: '',
|
2019-02-08 17:33:05 +03:00
|
|
|
nextChallengePath: '/',
|
2019-07-18 04:46:00 -05:00
|
|
|
prevChallengePath: '/',
|
2019-02-08 17:33:05 +03:00
|
|
|
introPath: '',
|
|
|
|
challengeType: -1
|
2018-04-06 14:51:52 +01:00
|
|
|
},
|
|
|
|
challengeTests: [],
|
2020-07-17 21:03:23 +02:00
|
|
|
consoleOut: [],
|
2019-12-02 15:48:53 +03:00
|
|
|
hasCompletedBlock: false,
|
2019-11-14 09:18:08 +01:00
|
|
|
inAccessibilityMode: false,
|
2018-05-09 12:40:09 +01:00
|
|
|
isCodeLocked: false,
|
2019-02-08 17:33:05 +03:00
|
|
|
isBuildEnabled: true,
|
2020-07-17 21:03:23 +02:00
|
|
|
logsOut: [],
|
2018-04-06 14:51:52 +01:00
|
|
|
modal: {
|
|
|
|
completion: false,
|
2018-05-09 12:40:09 +01:00
|
|
|
help: false,
|
2018-08-06 09:25:50 -04:00
|
|
|
video: false,
|
2018-05-09 12:40:09 +01:00
|
|
|
reset: false
|
2018-04-06 14:51:52 +01:00
|
|
|
},
|
2018-09-27 14:19:03 +03:00
|
|
|
projectFormValues: {},
|
2018-04-06 14:51:52 +01:00
|
|
|
successMessage: 'Happy Coding!'
|
|
|
|
};
|
|
|
|
|
|
|
|
export const types = createTypes(
|
|
|
|
[
|
|
|
|
'createFiles',
|
2018-05-08 00:29:45 +01:00
|
|
|
'createQuestion',
|
2018-04-06 14:51:52 +01:00
|
|
|
'initTests',
|
|
|
|
'initConsole',
|
2018-07-10 14:59:31 +02:00
|
|
|
'initLogs',
|
2018-04-06 14:51:52 +01:00
|
|
|
'updateConsole',
|
|
|
|
'updateChallengeMeta',
|
|
|
|
'updateFile',
|
|
|
|
'updateJSEnabled',
|
2020-05-07 17:19:06 +01:00
|
|
|
'updateSolutionFormValues',
|
2018-04-06 14:51:52 +01:00
|
|
|
'updateSuccessMessage',
|
|
|
|
'updateTests',
|
2018-07-10 14:59:31 +02:00
|
|
|
'updateLogs',
|
2020-02-03 15:22:49 +02:00
|
|
|
'cancelTests',
|
2018-07-10 14:59:31 +02:00
|
|
|
|
|
|
|
'logsToConsole',
|
2018-04-11 15:10:48 +01:00
|
|
|
|
2018-05-09 12:40:09 +01:00
|
|
|
'lockCode',
|
2018-04-11 15:10:48 +01:00
|
|
|
'unlockCode',
|
2019-02-08 17:33:05 +03:00
|
|
|
'disableBuildOnError',
|
2018-05-09 12:40:09 +01:00
|
|
|
'storedCodeFound',
|
|
|
|
'noStoredCodeFound',
|
2020-03-13 06:20:14 -07:00
|
|
|
'saveEditorContent',
|
2018-04-06 14:51:52 +01:00
|
|
|
|
|
|
|
'closeModal',
|
|
|
|
'openModal',
|
|
|
|
|
2018-12-07 14:08:32 +02:00
|
|
|
'previewMounted',
|
2018-05-09 12:40:09 +01:00
|
|
|
'challengeMounted',
|
2018-04-06 14:51:52 +01:00
|
|
|
'checkChallenge',
|
|
|
|
'executeChallenge',
|
2018-05-08 00:29:45 +01:00
|
|
|
'resetChallenge',
|
2018-05-09 12:40:09 +01:00
|
|
|
'submitChallenge',
|
2018-11-07 18:15:27 +00:00
|
|
|
|
2019-09-24 11:44:48 +02:00
|
|
|
'moveToTab',
|
|
|
|
|
2019-11-14 09:18:08 +01:00
|
|
|
'setEditorFocusability',
|
2019-12-02 15:48:53 +03:00
|
|
|
'setAccessibilityMode',
|
|
|
|
|
|
|
|
'lastBlockChalSubmitted'
|
2018-04-06 14:51:52 +01:00
|
|
|
],
|
|
|
|
ns
|
|
|
|
);
|
|
|
|
|
2018-11-07 18:15:27 +00:00
|
|
|
export const epics = [
|
|
|
|
challengeModalEpic,
|
|
|
|
codeLockEpic,
|
|
|
|
completionEpic,
|
|
|
|
createQuestionEpic,
|
2019-02-06 14:30:54 +03:00
|
|
|
codeStorageEpic
|
2018-11-07 18:15:27 +00:00
|
|
|
];
|
|
|
|
|
2018-11-26 02:17:38 +03:00
|
|
|
export const sagas = [
|
2019-02-06 14:30:54 +03:00
|
|
|
...createExecuteChallengeSaga(types),
|
|
|
|
...createCurrentChallengeSaga(types)
|
2018-11-26 02:17:38 +03:00
|
|
|
];
|
2018-11-07 18:15:27 +00:00
|
|
|
|
2020-06-25 17:25:30 +02:00
|
|
|
// TODO: can createPoly handle editable region, rather than separating it?
|
2018-04-06 14:51:52 +01:00
|
|
|
export const createFiles = createAction(types.createFiles, challengeFiles =>
|
|
|
|
Object.keys(challengeFiles)
|
|
|
|
.filter(key => challengeFiles[key])
|
|
|
|
.map(key => challengeFiles[key])
|
|
|
|
.reduce(
|
|
|
|
(challengeFiles, file) => ({
|
|
|
|
...challengeFiles,
|
|
|
|
[file.key]: {
|
|
|
|
...createPoly(file),
|
2020-06-25 17:25:30 +02:00
|
|
|
seed: file.contents.slice(0),
|
|
|
|
editableRegion: file.editableRegion
|
2018-04-06 14:51:52 +01:00
|
|
|
}
|
|
|
|
}),
|
|
|
|
{}
|
|
|
|
)
|
|
|
|
);
|
2018-11-07 18:15:27 +00:00
|
|
|
|
2018-05-08 00:29:45 +01:00
|
|
|
export const createQuestion = createAction(types.createQuestion);
|
2018-04-06 14:51:52 +01:00
|
|
|
export const initTests = createAction(types.initTests);
|
|
|
|
export const updateTests = createAction(types.updateTests);
|
2020-02-03 15:22:49 +02:00
|
|
|
export const cancelTests = createAction(types.cancelTests);
|
2018-04-06 14:51:52 +01:00
|
|
|
|
|
|
|
export const initConsole = createAction(types.initConsole);
|
2018-07-10 14:59:31 +02:00
|
|
|
export const initLogs = createAction(types.initLogs);
|
2018-04-06 14:51:52 +01:00
|
|
|
export const updateChallengeMeta = createAction(types.updateChallengeMeta);
|
|
|
|
export const updateFile = createAction(types.updateFile);
|
|
|
|
export const updateConsole = createAction(types.updateConsole);
|
2018-07-10 14:59:31 +02:00
|
|
|
export const updateLogs = createAction(types.updateLogs);
|
2018-04-06 14:51:52 +01:00
|
|
|
export const updateJSEnabled = createAction(types.updateJSEnabled);
|
2020-05-07 17:19:06 +01:00
|
|
|
export const updateSolutionFormValues = createAction(
|
|
|
|
types.updateSolutionFormValues
|
2018-05-24 19:45:38 +01:00
|
|
|
);
|
2018-04-06 14:51:52 +01:00
|
|
|
export const updateSuccessMessage = createAction(types.updateSuccessMessage);
|
|
|
|
|
2018-07-10 14:59:31 +02:00
|
|
|
export const logsToConsole = createAction(types.logsToConsole);
|
|
|
|
|
2018-05-09 12:40:09 +01:00
|
|
|
export const lockCode = createAction(types.lockCode);
|
2018-04-11 15:10:48 +01:00
|
|
|
export const unlockCode = createAction(types.unlockCode);
|
2019-02-08 17:33:05 +03:00
|
|
|
export const disableBuildOnError = createAction(types.disableBuildOnError);
|
2018-05-09 12:40:09 +01:00
|
|
|
export const storedCodeFound = createAction(types.storedCodeFound);
|
|
|
|
export const noStoredCodeFound = createAction(types.noStoredCodeFound);
|
2020-03-13 06:20:14 -07:00
|
|
|
export const saveEditorContent = createAction(types.saveEditorContent);
|
2018-04-06 14:51:52 +01:00
|
|
|
|
|
|
|
export const closeModal = createAction(types.closeModal);
|
|
|
|
export const openModal = createAction(types.openModal);
|
|
|
|
|
2018-12-11 23:05:15 +02:00
|
|
|
export const previewMounted = createAction(types.previewMounted);
|
2018-05-09 12:40:09 +01:00
|
|
|
export const challengeMounted = createAction(types.challengeMounted);
|
2018-04-06 14:51:52 +01:00
|
|
|
export const checkChallenge = createAction(types.checkChallenge);
|
|
|
|
export const executeChallenge = createAction(types.executeChallenge);
|
2018-05-08 00:29:45 +01:00
|
|
|
export const resetChallenge = createAction(types.resetChallenge);
|
2018-04-06 14:51:52 +01:00
|
|
|
export const submitChallenge = createAction(types.submitChallenge);
|
|
|
|
|
2018-12-07 14:08:32 +02:00
|
|
|
export const moveToTab = createAction(types.moveToTab);
|
|
|
|
|
2019-09-24 11:44:48 +02:00
|
|
|
export const setEditorFocusability = createAction(types.setEditorFocusability);
|
2019-11-14 09:18:08 +01:00
|
|
|
export const setAccessibilityMode = createAction(types.setAccessibilityMode);
|
2019-09-24 11:44:48 +02:00
|
|
|
|
2019-12-02 15:48:53 +03:00
|
|
|
export const lastBlockChalSubmitted = createAction(
|
|
|
|
types.lastBlockChalSubmitted
|
|
|
|
);
|
|
|
|
|
2018-12-07 14:08:32 +02:00
|
|
|
export const currentTabSelector = state => state[ns].currentTab;
|
2018-04-06 14:51:52 +01:00
|
|
|
export const challengeFilesSelector = state => state[ns].challengeFiles;
|
|
|
|
export const challengeMetaSelector = state => state[ns].challengeMeta;
|
|
|
|
export const challengeTestsSelector = state => state[ns].challengeTests;
|
|
|
|
export const consoleOutputSelector = state => state[ns].consoleOut;
|
2019-11-26 22:14:44 +05:30
|
|
|
export const completedChallengesIds = state =>
|
|
|
|
completedChallengesSelector(state).map(node => node.id);
|
2019-09-03 08:38:19 +01:00
|
|
|
export const isChallengeCompletedSelector = state => {
|
|
|
|
const completedChallenges = completedChallengesSelector(state);
|
|
|
|
const { id: currentChallengeId } = challengeMetaSelector(state);
|
|
|
|
return completedChallenges.some(({ id }) => id === currentChallengeId);
|
|
|
|
};
|
2018-05-09 12:40:09 +01:00
|
|
|
export const isCodeLockedSelector = state => state[ns].isCodeLocked;
|
2018-04-06 14:51:52 +01:00
|
|
|
export const isCompletionModalOpenSelector = state =>
|
2018-04-11 14:51:47 +01:00
|
|
|
state[ns].modal.completion;
|
2018-05-08 00:29:45 +01:00
|
|
|
export const isHelpModalOpenSelector = state => state[ns].modal.help;
|
2018-08-06 09:25:50 -04:00
|
|
|
export const isVideoModalOpenSelector = state => state[ns].modal.video;
|
2018-05-09 12:40:09 +01:00
|
|
|
export const isResetModalOpenSelector = state => state[ns].modal.reset;
|
2019-02-08 17:33:05 +03:00
|
|
|
export const isBuildEnabledSelector = state => state[ns].isBuildEnabled;
|
2018-04-06 14:51:52 +01:00
|
|
|
export const successMessageSelector = state => state[ns].successMessage;
|
|
|
|
|
2018-09-27 14:19:03 +03:00
|
|
|
export const projectFormValuesSelector = state =>
|
|
|
|
state[ns].projectFormValues || {};
|
2018-05-24 19:45:38 +01:00
|
|
|
|
2019-02-08 17:33:05 +03:00
|
|
|
export const challengeDataSelector = state => {
|
|
|
|
const { challengeType } = challengeMetaSelector(state);
|
|
|
|
let challengeData = { challengeType };
|
|
|
|
if (
|
|
|
|
challengeType === challengeTypes.js ||
|
|
|
|
challengeType === challengeTypes.bonfire
|
|
|
|
) {
|
|
|
|
challengeData = {
|
|
|
|
...challengeData,
|
|
|
|
files: challengeFilesSelector(state)
|
|
|
|
};
|
|
|
|
} else if (challengeType === challengeTypes.backend) {
|
2020-05-26 08:48:57 -05:00
|
|
|
const { solution: url = {} } = projectFormValuesSelector(state);
|
2019-02-08 17:33:05 +03:00
|
|
|
challengeData = {
|
|
|
|
...challengeData,
|
|
|
|
url
|
|
|
|
};
|
2020-02-25 00:10:32 +05:30
|
|
|
} else if (
|
|
|
|
challengeType === challengeTypes.backEndProject ||
|
|
|
|
challengeType === challengeTypes.pythonProject
|
|
|
|
) {
|
2019-06-11 18:46:36 +03:00
|
|
|
const values = projectFormValuesSelector(state);
|
|
|
|
const { solution: url } = values;
|
|
|
|
challengeData = {
|
|
|
|
...challengeData,
|
|
|
|
...values,
|
|
|
|
url
|
|
|
|
};
|
|
|
|
} else if (challengeType === challengeTypes.frontEndProject) {
|
2019-02-08 17:33:05 +03:00
|
|
|
challengeData = {
|
|
|
|
...challengeData,
|
|
|
|
...projectFormValuesSelector(state)
|
|
|
|
};
|
|
|
|
} else if (
|
|
|
|
challengeType === challengeTypes.html ||
|
|
|
|
challengeType === challengeTypes.modern
|
|
|
|
) {
|
|
|
|
const { required = [], template = '' } = challengeMetaSelector(state);
|
|
|
|
challengeData = {
|
|
|
|
...challengeData,
|
|
|
|
files: challengeFilesSelector(state),
|
|
|
|
required,
|
|
|
|
template
|
|
|
|
};
|
|
|
|
}
|
|
|
|
return challengeData;
|
|
|
|
};
|
|
|
|
|
2019-09-24 11:44:48 +02:00
|
|
|
export const canFocusEditorSelector = state => state[ns].canFocusEditor;
|
2019-11-14 09:18:08 +01:00
|
|
|
export const inAccessibilityModeSelector = state =>
|
|
|
|
state[ns].inAccessibilityMode;
|
2019-09-24 11:44:48 +02:00
|
|
|
|
2018-04-06 14:51:52 +01:00
|
|
|
export const reducer = handleActions(
|
|
|
|
{
|
|
|
|
[types.createFiles]: (state, { payload }) => ({
|
|
|
|
...state,
|
|
|
|
challengeFiles: payload
|
|
|
|
}),
|
2018-05-08 00:29:45 +01:00
|
|
|
[types.updateFile]: (state, { payload: { key, editorValue } }) => ({
|
|
|
|
...state,
|
|
|
|
challengeFiles: {
|
|
|
|
...state.challengeFiles,
|
|
|
|
[key]: {
|
|
|
|
...state.challengeFiles[key],
|
|
|
|
contents: editorValue
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}),
|
2018-05-09 12:40:09 +01:00
|
|
|
[types.storedCodeFound]: (state, { payload }) => ({
|
|
|
|
...state,
|
|
|
|
challengeFiles: payload
|
|
|
|
}),
|
|
|
|
|
2018-04-06 14:51:52 +01:00
|
|
|
[types.initTests]: (state, { payload }) => ({
|
|
|
|
...state,
|
|
|
|
challengeTests: payload
|
|
|
|
}),
|
|
|
|
[types.updateTests]: (state, { payload }) => ({
|
|
|
|
...state,
|
|
|
|
challengeTests: payload
|
|
|
|
}),
|
2018-05-09 12:40:09 +01:00
|
|
|
|
2018-04-06 14:51:52 +01:00
|
|
|
[types.initConsole]: (state, { payload }) => ({
|
|
|
|
...state,
|
2020-07-17 21:03:23 +02:00
|
|
|
consoleOut: payload ? [payload] : []
|
2018-04-06 14:51:52 +01:00
|
|
|
}),
|
|
|
|
[types.updateConsole]: (state, { payload }) => ({
|
|
|
|
...state,
|
2020-07-17 21:03:23 +02:00
|
|
|
consoleOut: state.consoleOut.concat(payload)
|
2018-04-06 14:51:52 +01:00
|
|
|
}),
|
2018-07-10 14:59:31 +02:00
|
|
|
[types.initLogs]: state => ({
|
|
|
|
...state,
|
2020-07-17 21:03:23 +02:00
|
|
|
logsOut: []
|
2018-07-10 14:59:31 +02:00
|
|
|
}),
|
|
|
|
[types.updateLogs]: (state, { payload }) => ({
|
|
|
|
...state,
|
2020-07-17 21:03:23 +02:00
|
|
|
logsOut: state.logsOut.concat(payload)
|
2018-07-10 14:59:31 +02:00
|
|
|
}),
|
|
|
|
[types.logsToConsole]: (state, { payload }) => ({
|
|
|
|
...state,
|
2020-07-17 21:03:23 +02:00
|
|
|
consoleOut: isEmpty(state.logsOut)
|
|
|
|
? state.consoleOut
|
|
|
|
: state.consoleOut.concat(payload, state.logsOut)
|
2018-07-10 14:59:31 +02:00
|
|
|
}),
|
2018-05-08 00:29:45 +01:00
|
|
|
[types.updateChallengeMeta]: (state, { payload }) => ({
|
|
|
|
...state,
|
|
|
|
challengeMeta: { ...payload }
|
|
|
|
}),
|
|
|
|
|
|
|
|
[types.resetChallenge]: state => ({
|
2018-04-06 14:51:52 +01:00
|
|
|
...state,
|
2018-12-07 14:08:32 +02:00
|
|
|
currentTab: 2,
|
2018-04-06 14:51:52 +01:00
|
|
|
challengeFiles: {
|
2018-05-08 00:29:45 +01:00
|
|
|
...Object.keys(state.challengeFiles)
|
|
|
|
.map(key => state.challengeFiles[key])
|
|
|
|
.reduce(
|
|
|
|
(files, file) => ({
|
|
|
|
...files,
|
|
|
|
[file.key]: {
|
|
|
|
...file,
|
2020-06-25 17:25:30 +02:00
|
|
|
contents: file.seed.slice(),
|
|
|
|
editableRegion: file.editableRegion
|
2018-05-08 00:29:45 +01:00
|
|
|
}
|
|
|
|
}),
|
|
|
|
{}
|
|
|
|
)
|
|
|
|
},
|
|
|
|
challengeTests: state.challengeTests.map(({ text, testString }) => ({
|
|
|
|
text,
|
|
|
|
testString
|
|
|
|
})),
|
2020-07-17 21:03:23 +02:00
|
|
|
consoleOut: []
|
2018-04-06 14:51:52 +01:00
|
|
|
}),
|
2020-05-07 17:19:06 +01:00
|
|
|
[types.updateSolutionFormValues]: (state, { payload }) => ({
|
2018-05-24 19:45:38 +01:00
|
|
|
...state,
|
2018-09-27 14:19:03 +03:00
|
|
|
projectFormValues: payload
|
2018-05-24 19:45:38 +01:00
|
|
|
}),
|
2018-05-09 12:40:09 +01:00
|
|
|
|
|
|
|
[types.lockCode]: state => ({
|
|
|
|
...state,
|
|
|
|
isCodeLocked: true
|
|
|
|
}),
|
2018-04-11 15:10:48 +01:00
|
|
|
[types.unlockCode]: state => ({
|
|
|
|
...state,
|
2019-02-08 17:33:05 +03:00
|
|
|
isBuildEnabled: true,
|
2018-05-09 12:40:09 +01:00
|
|
|
isCodeLocked: false
|
2018-04-11 15:10:48 +01:00
|
|
|
}),
|
2019-11-07 14:35:17 +01:00
|
|
|
[types.disableBuildOnError]: state => ({
|
2018-04-06 14:51:52 +01:00
|
|
|
...state,
|
2019-02-08 17:33:05 +03:00
|
|
|
isBuildEnabled: false
|
2018-04-06 14:51:52 +01:00
|
|
|
}),
|
2018-05-09 12:40:09 +01:00
|
|
|
|
2018-04-06 14:51:52 +01:00
|
|
|
[types.updateSuccessMessage]: (state, { payload }) => ({
|
|
|
|
...state,
|
|
|
|
successMessage: payload
|
|
|
|
}),
|
|
|
|
[types.closeModal]: (state, { payload }) => ({
|
|
|
|
...state,
|
|
|
|
modal: {
|
|
|
|
...state.modal,
|
|
|
|
[payload]: false
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
[types.openModal]: (state, { payload }) => ({
|
|
|
|
...state,
|
|
|
|
modal: {
|
|
|
|
...state.modal,
|
|
|
|
[payload]: true
|
|
|
|
}
|
2018-12-07 14:08:32 +02:00
|
|
|
}),
|
|
|
|
[types.moveToTab]: (state, { payload }) => ({
|
|
|
|
...state,
|
|
|
|
currentTab: payload
|
|
|
|
}),
|
2019-02-06 14:30:54 +03:00
|
|
|
[types.executeChallenge]: state => ({
|
2018-12-07 14:08:32 +02:00
|
|
|
...state,
|
|
|
|
currentTab: 3
|
2019-09-24 11:44:48 +02:00
|
|
|
}),
|
|
|
|
[types.setEditorFocusability]: (state, { payload }) => ({
|
|
|
|
...state,
|
|
|
|
canFocusEditor: payload
|
2019-11-14 09:18:08 +01:00
|
|
|
}),
|
|
|
|
[types.setAccessibilityMode]: (state, { payload }) => ({
|
|
|
|
...state,
|
|
|
|
inAccessibilityMode: payload
|
2018-04-06 14:51:52 +01:00
|
|
|
})
|
|
|
|
},
|
|
|
|
initialState
|
|
|
|
);
|