Skip to content
Snippets Groups Projects
Commit 99f0d3ed authored by Adam Procter's avatar Adam Procter
Browse files

getting there with adding nodes

nodes are added but the page is not refreshed unless you edit a node then add a new node
parent 918133ca
No related branches found
No related tags found
No related merge requests found
......@@ -26,16 +26,16 @@ export default {
// n key pressed
this.addNode()
}),
shortcuts('ArrowRight', function () {
// Arrow right key was pressed
console.log('->')
shortcuts('c', function () {
// c key was pressed
console.log('connection mode')
}),
],
methods: {
addNode() {
this.$store.dispatch('addNode')
this.$emit('added-node')
this.$store.dispatch('addNode')
},
},
}
......
......@@ -56,6 +56,16 @@ export default {
mounted() {
setTimeout(this.loadData, 500)
// NOT SURE THIS IS DOING ANYTHING ???
// const unwatch = this.$watch('nodesFiltered', (value) => {
// this.$options.myArray = this.nodesFiltered
// this.$forceUpdate()
// // ignore falsy values
// if (!value) return
// // stop watching when nodesFiltered[] is not empty
// if (value && value.length) unwatch()
// // process value here
// })
},
watch: {
......
......@@ -83,10 +83,9 @@ export const mutations = {
for (i = 0; i < Object.keys(doc.nodes).length; i++) {
state.myNodes = doc.nodes
}
console.log(state.myNodes)
})
.catch(function () {
// console.log(err)
.catch(function (err) {
console.log(err)
})
},
......
......@@ -67,9 +67,7 @@ export const actions = {
startDB: (vuexContext) => {
pouchdb.replicate.from(remote).on('complete', function () {
// GET_MYNODES from mynodes.js ACTION
//console.log('start')
vuexContext.dispatch('getNodes', null, { root: true })
//dispatch('getNodes')
pouchdb
.sync(remote, {
live: true,
......@@ -77,12 +75,12 @@ export const actions = {
retry: true,
})
.on('change', function () {
// GET_MYNODES
console.log('change')
vuexContext.dispatch('getNodes', null, { root: true })
})
.on('paused', function () {})
.on('active', function () {})
.on('active', function () {
vuexContext.dispatch('getNodes', null, { root: true })
})
.on('denied', function () {})
.on('complete', function () {})
.on('error', function (err) {
......
......@@ -25,10 +25,10 @@ export default {
}
},
method: {
methods: {
addedNode() {
console.log('I hear')
//this.added = !this.added
//console.log('I hear you!')
this.added = !this.added
},
},
}
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment