Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
[EDITOR_UNDO](state) {
const lenght = state.currentRadonMarkupInterpreter.retrieve.length
if (state.history[state.historyIndex - 1]) {
state.historyIndex = state.historyIndex - 1
state.currentRadonMarkupInterpreter = new Radon(state.history[state.historyIndex])
state.radRequest = state.currentRadonMarkupInterpreter
let currentLenght = state.radRequest.retrieve.length
if (lenght > currentLenght) {
this.commit(MOVE_CAROUSEL, { direction: 'right' })
} else if (lenght < currentLenght) {
this.commit(MOVE_CAROUSEL, { direction: 'left' })
}
}
},
[MOVE_CAROUSEL](state, { direction }) {
[SET_CURRENT_TEMPLATE](state, { id }) {
const template = state.templates[id]
state.currentTemplate = template
state.currentRadonMarkupInterpreter = new Radon(state.currentTemplate.radRequest)
state.radRequest = state.currentRadonMarkupInterpreter
state.history = [state.currentTemplate]
},
[PUSH_OPERATOR](state, { scriptId }) {
state.currentTemplate = {
creationDate: Date.now(),
id: generateId(),
name: name,
description: '',
radRequest,
variables: [
{
key: 'key_' + 0,
value: 'value',
},
],
variablesIndex: 0,
usedVariables: [],
}
state.currentRadonMarkupInterpreter = new Radon(radRequest)
state.radRequest = state.currentRadonMarkupInterpreter
state.history = [state.currentTemplate]
},
[SET_CURRENT_TEMPLATE](state, { id }) {