Commit e6ca2e9e authored by Adam Procter's avatar Adam Procter
Browse files

fixing add nodes

parent 6e2c2329
......@@ -47,11 +47,16 @@ export default {
computed: {
...mapState({
// TODO: Can you filter here instead ?
myNodes: (state) => state.myNodes,
}),
},
watch: {
added: function () {
this.loadData()
},
},
mounted() {
//console.log('mounted')
setTimeout(this.loadData, 500)
......@@ -68,11 +73,11 @@ export default {
methods: {
loadData() {
// console.log('loading data')
var nodesFiltered = this.myNodes.myNodes.filter(
(nodes) => nodes.node_deleted == false
)
this.$store.dispatch('getMynodes')
this.myArray = nodesFiltered.reverse()
},
......
......@@ -39,7 +39,6 @@ export default {
this.$store.dispatch('addNode')
},
exitMicrocosm() {
localStorage.removeItem('nogg_microcosm')
localStorage.removeItem('nogg_name')
......
<template>
<ToolBar @added-node="addedNode" />
<MyNodes :added="added" :key="componentKey" />
<MyNodes :added="added" />
</template>
<script>
......@@ -21,20 +21,13 @@ export default {
data() {
return {
componentKey: 0,
added: true,
added: false,
}
},
methods: {
addedNode() {
//console.log('I hear you!')
this.added = !this.added
this.forceRender()
},
forceRender() {
// reloads the data after adding a node
this.componentKey += 1
},
},
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment