add history

This commit is contained in:
axolotle
2021-06-30 21:09:02 +02:00
parent 626673c0af
commit 8af8bbc73f
7 changed files with 257 additions and 4 deletions
+4 -1
View File
@@ -134,8 +134,10 @@ export default {
async 'UPDATE_NODEBOOK' ({ state, commit, dispatch }, query) {
const { mode = 'tree', nodebook } = parseNodesQueryParams(query)
commit('SET_MODE', mode)
await dispatch('GET_NODES', { ids: [].concat(...nodebook), dataLevel: 'full' })
const ids = [].concat(...nodebook)
await dispatch('GET_NODES', { ids, dataLevel: 'full' })
commit('SET_NODEBOOK', nodebook)
commit('ADD_HISTORY_ENTRIES', ids)
},
// ╭╮╷╭─╮┌─╮┌─╴╭─╴
@@ -157,6 +159,7 @@ export default {
const stack = state.nodebook.find(stack => stack[0] === parentId)
commit('ADD_NODEBOOK_NODE', [stack, parentId, childId])
dispatch('UPDATE_QUERY_NODES')
commit('ADD_HISTORY_ENTRIES', [childId || parentId])
},
'CLOSE_NODE' ({ state, commit, dispatch }, { parentId, childId }) {