From 5a33dcd2ed4a3fb368c9df4af9d53db5d010cf45 Mon Sep 17 00:00:00 2001
From: Adam Procter <adamprocter@mac.com>
Date: Fri, 25 Dec 2020 16:07:37 +0000
Subject: [PATCH] looks like force update or force rerender dont play well with
 history mode

---
 app/.env                         |  2 +-
 app/src/components/ListLayer.vue | 16 ++++++++++++----
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/app/.env b/app/.env
index 8ca3b90..1e397d3 100644
--- a/app/.env
+++ b/app/.env
@@ -1,4 +1,4 @@
 VUE_APP_COUCH_HTTP=http
 VUE_APP_COUCH_USER=auto-admin
 VUE_APP_COUCH_PASS=testing@
-VUE_APP_COUCH_URL=127.0.0.1:5984/
\ No newline at end of file
+VUE_APP_COUCH_URL=192.168.1.179:5984/
\ No newline at end of file
diff --git a/app/src/components/ListLayer.vue b/app/src/components/ListLayer.vue
index a7623d0..28a5f75 100644
--- a/app/src/components/ListLayer.vue
+++ b/app/src/components/ListLayer.vue
@@ -1,5 +1,5 @@
 <template>
-  <div>
+  <div :key="componentKey">
     <div v-for="(nodes, index) in $options.myArray" v-bind:key="index">
       <form
         class="nodes"
@@ -87,6 +87,7 @@ export default {
 
   data: function () {
     return {
+      componentKey: 0,
       color: '#9bc2d8',
       shapes: 'circles',
       // swatches: [{ color: '#F493A7', showBorder: true }],
@@ -109,7 +110,7 @@ export default {
   computed: {
     ...mapState({
       myNodes: (state) => state.myNodes,
-      configPositions: (state) => state.configPositions,
+      //  configPositions: (state) => state.configPositions,
       configEmoji: (state) => state.configEmoji,
       // toolmode: (state) => state.ui.mode,
     }),
@@ -126,7 +127,8 @@ export default {
 
     const unwatch = this.$watch('nodes_filtered', (value) => {
       this.$options.myArray = this.nodes_filtered
-      this.$forceUpdate()
+      this.forceRerender()
+      //this.$forceUpdate()
       // this.focusInput()
       // ignore falsy values
       if (!value) return
@@ -156,6 +158,10 @@ export default {
   },
 
   methods: {
+    forceRerender(child) {
+      console.log(child)
+      this.componentKey += 1
+    },
     chooseColor(color, nodeid) {
       this.$store.dispatch('colorNode', { nodeid, color })
       this.$options.myArray = this.nodes_filtered
@@ -164,8 +170,10 @@ export default {
       this.update = !this.update
     },
     loadData() {
+      console.log('called')
       this.$options.myArray = this.nodes_filtered
-      this.$forceUpdate()
+      this.forceRerender()
+      //this.$forceUpdate()
     },
     editNode(e) {
       var nodeid = e.target.id
-- 
GitLab