Commit 8eca6bfb authored by Adam Procter's avatar Adam Procter

some minor housekeeping

parent 00cd5aff
Pipeline #233 failed with stages
......@@ -77,7 +77,6 @@ console.log(this.$store.state.knowledge_db.allDocs());
// when fired loops through applying all the positions if id matches
// needs to be running this update in Realtime to update moves
// maybe in watch: { } ??? function ???
// FIXMEneed to make arrow function
nodes.on("startyourpositions", event => {
console.log("hit");
});
......
......@@ -2,13 +2,6 @@ import Vue from "vue";
import Vuex from "vuex";
import pouchdb from "pouchdb";
// server admin has to create DB first and CORS allows specific domains.
//https://nn.adamprocter.co.uk/accounts etc
//these vars may no longer needed as far as I know we use pouchdb.sync inline now see FIXME line below
//var remote_accounts_db = new pouchdb('https://nn.adamprocter.co.uk/accounts');
//var remote_knowledge_db = new pouchdb('https://nn.adamprocter.co.uk/knowledge');
Vue.use(Vuex);
const LOGIN = "LOGIN";
......@@ -27,7 +20,6 @@ export default new Vuex.Store({
},
mutations: {
// FIXME this is not right - data is undefined at this moment
DB_INIT(state) {
state.accounts_db = new pouchdb("accounts");
state.knowledge_db = new pouchdb("knowledge");
......@@ -64,7 +56,7 @@ export default new Vuex.Store({
token: payload.token,
verified: payload.verified
});
// FIXME this does sync but does it pass the changes we want to capture via VUEX STORE
// FIXME this does sync BUT does it pass the changes we want to capture via VUEX STORE
pouchdb.sync("accounts", "https://nn.adamprocter.co.uk/accounts");
},
......@@ -128,12 +120,11 @@ export default new Vuex.Store({
xpos: 0,
ypos: 0
});
// FIXME this does sync but does it pass the changes we want to capture via VUEX STORE
// FIXME this does sync BUT does it pass the changes we want to capture via VUEX STORE
pouchdb.sync("knowledge", "https://nn.adamprocter.co.uk/knowledge");
pouchdb.sync("positions", "https://nn.adamprocter.co.uk/positions");
},
// FIXME called on mouse up but not always heard..
UPDATE_KNOWLEDGE_POSITION(state, payload) {
var id = payload.id;
id.toString();
......@@ -141,7 +132,7 @@ export default new Vuex.Store({
(updater.xpos = payload.xpos),
(updater.ypos = payload.ypos),
state.positions_db.put(updater).then(function() {
// FIXME this does sync but does it pass the changes we want to capture via VUEX STORE
// FIXME this does sync BUT does it pass the changes we want to capture via VUEX STORE
pouchdb.sync("positions", "https://nn.adamprocter.co.uk/positions");
});
});
......
......@@ -6,11 +6,6 @@
</template>
<script>
// FIXME remove this as in Store.js now ??
//import pouchdb from 'pouchdb'
//var localdb = new pouchdb('knowledge');
//server admin has to create DB first and CORS allows specific domains.
//var db = new pouchdb('https://nn.adamprocter.co.uk/knowledge');
// @ is an alias to /src
import instance from "@/components/current-instance.vue";
......@@ -28,25 +23,12 @@ export default {
},
created() {
// FIXME what should the store do here
// this.$store.state.count
this.$store.dispatch("showKnowledgeObjects");
this.$store.dispatch("getKnowledgePositions");
//this.$store.getters.allObjects
//return this.$store.getters.allObjects
// if (db){
// localdb.sync(db)
// }
// localdb.allDocs({
// include_docs: true,
// attachments: true
// }).then(result => {
// Array.from(result.rows.values()).forEach((element) => {
// this.$store.dispatch('showKnowledgeObjects', element)
// })
// })
}
};
</script>
Markdown is supported
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