From d7ed93b1fa7095d3e85c6c069ed70dae8f792836 Mon Sep 17 00:00:00 2001
From: Adam Procter <adamprocter@researchnot.es>
Date: Mon, 30 Nov 2020 18:16:45 +0000
Subject: [PATCH] more v-for tweaks

---
 app/src/components/ListLayer.vue | 30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/app/src/components/ListLayer.vue b/app/src/components/ListLayer.vue
index 3ceed0b..7090bd3 100644
--- a/app/src/components/ListLayer.vue
+++ b/app/src/components/ListLayer.vue
@@ -90,14 +90,18 @@ export default {
     marked: marked,
   },
 
-  computed: mapState({
-    myNodes: (state) => state.myNodes,
-    configPositions: (state) => state.configPositions,
-    configEmoji: (state) => state.configEmoji,
+  computed: {
+    ...mapState({
+      myNodes: (state) => state.myNodes,
+      configPositions: (state) => state.configPositions,
+      configEmoji: (state) => state.configEmoji,
+    }),
 
     // FIXME: these filters dont work yet
-    nodes: () => {
-      return this.nodes.filter(function (node) {
+    // ALSO dont forget you did this.$options.myArray = this.myNodes
+    // Otherwise your hit the realtimesync issue again
+    nodes() {
+      return this.nodes.filter((node) => {
         return (
           (node == this.myNodes.node_id) == this.configPositions.node_id &&
           this.myNodes.deleted == false &&
@@ -105,24 +109,26 @@ export default {
         )
       })
     },
-    readnodes: () => {
-      return this.readnodes.filter(function (node) {
+
+    readnodes() {
+      return this.readnodes.filter((readnode) => {
         return (
-          (node == this.myNodes.node_id) == this.configPositions.node_id &&
+          (readnode == this.myNodes.node_id) == this.configPositions.node_id &&
           this.myNodes.deleted == false &&
           this.configPositions.read_mode == true
         )
       })
     },
-    emojis: () => {
-      return this.nodes.filter(function (emoji) {
+
+    emojis() {
+      return this.emojis.filter((emoji) => {
         return (
           (emoji == this.myNodes.node_id) == this.configPositions.node_id &&
           this.myNodes.deleted == false
         )
       })
     },
-  }),
+  },
 
   myArray: null,
   created() {
-- 
GitLab