Commit 2984b526 authored by ap2x07's avatar ap2x07
Browse files

more on node adding

parent 99f0d3ed
......@@ -28,7 +28,7 @@ export default {
}),
shortcuts('c', function () {
// c key was pressed
console.log('connection mode')
console.log('c key was pressed')
}),
],
......
<template>
<div v-for="(nodes, index) in myArray" v-bind:key="index">
<form class="nodes">
<p>{{ nodes.node_id }}</p>
<template v-if="nodes.node_readmode == false">
<textarea
v-model="nodes.node_text"
......@@ -100,4 +98,8 @@ export default {
margin-top: 1em;
margin-left: 0.5em;
}
textarea {
width: 95%;
}
</style>
......@@ -43,6 +43,7 @@ export const mutations = {
// this was to set quick focus on new nodes
// i think... need to check old code
state.activeNode = newNode
this.getNodes()
})
})
.catch(function (err) {
......@@ -76,6 +77,7 @@ export const mutations = {
})
},
GET_NODES() {
// console.log('called ' + deviceName)
pouchdb
.get(deviceName)
.then(function (doc) {
......@@ -137,7 +139,11 @@ export const actions = {
},
getMicrocosm(vuexContext) {
pouchdb = vuexContext.rootState.setup.pouchdb
// var lastmicrocosm = localStorage.getItem('nogg_microcosm')
// pouchdb = new PouchDB(lastmicrocosm)
// deviceName = localStorage.getItem('nogg_name')
//vuexContext.dispatch('startDB', null, { root: true })
deviceName = vuexContext.rootState.setup.deviceName
pouchdb = vuexContext.rootState.setup.pouchdb
},
}
......@@ -14,6 +14,9 @@ export const mutations = {
SET_MICROCOSM(state, e) {
state.deviceName = e.devicename
state.microcosmName = e.microcosm
// if (state.microcosmName == '') {
// console.log('empty')
// }
pouchdb = new PouchDB(state.microcosmName)
state.pouchdb = pouchdb
......@@ -65,11 +68,15 @@ export const actions = {
},
startDB: (vuexContext) => {
// if (pouchdb == undefined) {
// var lastmicrocosm = localStorage.getItem('nogg_microcosm')
// pouchdb = new PouchDB(lastmicrocosm)
// }
pouchdb.replicate.from(remote).on('complete', function () {
// GET_MYNODES from mynodes.js ACTION
vuexContext.dispatch('getNodes', null, { root: true })
pouchdb
.sync(remote, {
.sync(state.remoteAddress, {
live: true,
since: 'now',
retry: true,
......
This diff is collapsed.
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