2020-03-13 15:44:24 +05:30
|
|
|
import * as types from './mutation_types';
|
|
|
|
|
|
|
|
export default {
|
2022-06-21 17:19:12 +05:30
|
|
|
[types.SET_INITIAL_DATA](state, { blobs, definitionPathPrefix, wrapTextNodes }) {
|
2020-04-22 19:07:51 +05:30
|
|
|
state.blobs = blobs;
|
|
|
|
state.definitionPathPrefix = definitionPathPrefix;
|
2022-06-21 17:19:12 +05:30
|
|
|
state.wrapTextNodes = wrapTextNodes;
|
2020-03-13 15:44:24 +05:30
|
|
|
},
|
|
|
|
[types.REQUEST_DATA](state) {
|
|
|
|
state.loading = true;
|
|
|
|
},
|
2020-04-22 19:07:51 +05:30
|
|
|
[types.REQUEST_DATA_SUCCESS](state, { path, normalizedData }) {
|
2020-03-13 15:44:24 +05:30
|
|
|
state.loading = false;
|
2020-04-22 19:07:51 +05:30
|
|
|
state.data = { ...state.data, [path]: normalizedData };
|
2020-03-13 15:44:24 +05:30
|
|
|
},
|
|
|
|
[types.REQUEST_DATA_ERROR](state) {
|
|
|
|
state.loading = false;
|
|
|
|
},
|
2020-05-24 23:13:21 +05:30
|
|
|
[types.SET_CURRENT_DEFINITION](state, { definition, position, blobPath }) {
|
2020-03-13 15:44:24 +05:30
|
|
|
state.currentDefinition = definition;
|
|
|
|
state.currentDefinitionPosition = position;
|
2020-05-24 23:13:21 +05:30
|
|
|
state.currentBlobPath = blobPath;
|
2020-03-13 15:44:24 +05:30
|
|
|
},
|
|
|
|
};
|