Commit 4be341b3 authored by Adam Procter's avatar Adam Procter

more attempts

parent ec127d43
Pipeline #205 failed with stages
in 1 minute and 7 seconds
This diff is collapsed.
......@@ -17,8 +17,8 @@ const LOGOUT = "LOGOUT";
export default new Vuex.Store({
state: {
// should this be here now
allobjects: [],
// registeraccount:[],
database: null,
isLoggedIn: !!localStorage.getItem("token"),
},
......@@ -59,21 +59,22 @@ export default new Vuex.Store({
},
SHOW_KNOWLEDGE_OBJECTS (data, payload) {
var ids = [];
accounts_db.allDocs({
SHOW_KNOWLEDGE_OBJECTS (state) {
var ids = []
var knowledge = []
knowledge = knowledge_db.allDocs({
include_docs: true,
attachments: true
})
state.allobjects.forEach(item => {ids.push(item.id)})
if (!ids.includes(payload.id)){
state.allobjects.push(payload);
}
})
console.log(knowledge.type)
// knowledge = state.allobjects
// state.allobjects.forEach(item => {ids.push(item.id)})
// if (!ids.includes(knowledge.id)){
// state.allobjects.push(knowledge);
//
//accounts_db.allDocs({
// include_docs: true,
// attachments: true
......
......@@ -33,7 +33,7 @@ export default {
// what should the store do here
// this.$store.state.count
this.$store.dispatch('showKnowledgeObjects')
this.$store.getters.allObjects
//return this.$store.getters.allObjects
// if (db){
// localdb.sync(db)
......
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