Commit e90f9d41 authored by Adam Procter's avatar Adam Procter

Merge branch 'pouchdb_tweak'

parents bd10cd79 44c31a64
Pipeline #170 failed with stages
in 1 minute and 21 seconds
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.ico><title>nn2</title><link href=/css/about.ff293c24.css rel=prefetch><link href=/css/home.a45d8d52.css rel=prefetch><link href=/js/about.f2f86df9.js rel=prefetch><link href=/js/home.1bcb97da.js rel=prefetch><link href=/css/app.074079a2.css rel=preload as=style><link href=/js/app.94ae5a46.js rel=preload as=script><link href=/js/chunk-vendors.c055d76a.js rel=preload as=script><link href=/css/app.074079a2.css rel=stylesheet></head><body><noscript><strong>We're sorry but nn2 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div></body></html><script src=/js/chunk-vendors.c055d76a.js></script><script src=/js/app.94ae5a46.js></script>
\ No newline at end of file
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=/favicon.ico><title>nn2</title><link href=/css/about.ff293c24.css rel=prefetch><link href=/css/home.a45d8d52.css rel=prefetch><link href=/js/about.f2f86df9.js rel=prefetch><link href=/js/home.e8d80d2c.js rel=prefetch><link href=/css/app.074079a2.css rel=preload as=style><link href=/js/app.86f0a9fd.js rel=preload as=script><link href=/js/chunk-vendors.c055d76a.js rel=preload as=script><link href=/css/app.074079a2.css rel=stylesheet></head><body><noscript><strong>We're sorry but nn2 doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app></div></body></html><script src=/js/chunk-vendors.c055d76a.js></script><script src=/js/app.86f0a9fd.js></script>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
<template>
<div id="knowledgeobject">
<ul>
<!-- <li>id = {{object.id}}</li>
......
......@@ -22,7 +22,11 @@ export default new Vuex.Store({
},
mutations: {
ADD_KNOWLEDGE_OBJECT (state, payload) {
state.allobjects.push(payload);
var ids = [];
state.allobjects.forEach(item => {ids.push(item.id)})
if (!ids.includes(payload.id)){
state.allobjects.push(payload);
}
},
LOGIN (state) {
state.pending = true;
......
......@@ -3,6 +3,7 @@
<logo></logo>
<instance :instancename="instancename">
</instance>
</section>
</template>
......@@ -10,7 +11,7 @@
import pouchdb from 'pouchdb'
var localdb = new pouchdb('knowledge');
// server admin has to create DB first and CORS allows specific domains.
//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
......@@ -18,6 +19,7 @@ import instance from "@/components/current-instance.vue";
import logo from "@/components/instance-logo.vue";
import { mapActions } from 'vuex';
export default {
name: 'home',
components: {
......@@ -33,7 +35,9 @@ export default {
instancename: String
},
created() {
if (db) localdb.sync(db)
if (db){
localdb.sync(db)
}
localdb.allDocs({
include_docs: true,
......@@ -43,6 +47,7 @@ export default {
this.$store.dispatch('addKnowledgeObject', element)
})
})
}
}
......
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