From bee587fb9041bc7009651be1f34509c96e53d763 Mon Sep 17 00:00:00 2001
From: Adam Procter <adamprocter@researchnot.es>
Date: Fri, 23 Oct 2020 15:18:40 +0100
Subject: [PATCH] fixing issue with iOS

---
 .DS_Store                      | Bin 10244 -> 10244 bytes
 CHANGELOG.md                   |  15 ++++-
 app/package.json               |   2 +-
 app/src/App.vue                |   2 +-
 app/src/components/OnBoard.vue |  20 +++----
 app/src/router/index.js        |   3 +-
 app/src/store/index.js         |  23 ++++----
 app/src/views/Cards.vue        |  22 --------
 app/src/views/Discarded.vue    |  25 +--------
 app/src/views/Home.vue         |   3 +-
 app/src/views/List-old.vue     | 100 +++++++++++++++++++++++++++++++++
 app/src/views/List.vue         |  38 +++----------
 12 files changed, 152 insertions(+), 101 deletions(-)
 create mode 100644 app/src/views/List-old.vue

diff --git a/.DS_Store b/.DS_Store
index 63510f15264f0c19ae44d699b9e61dfc53c2918b..13cf4b32c8de27b40f64c35a81334e7b4783bc3f 100644
GIT binary patch
delta 102
zcmZn(XbIThF2HzlvWGx}r$lwNiKVHIf~k>lt&T#qxw(Okf{C$NZ7nB<xT>M8XF_ge
mRdr2m-Ao2BU}S{Q4E#_UM$OtRB>0tYGn>M1md#9}%*+5IFBSv<

delta 76
zcmZn(XbIThF2HzdvWGx}mSlCcu7#zcj)IAaS*?yjwYj+gkZo*MTg%BIu4-uOnUGsq
fRb5kCH*4}o0eQyRn*{~G@@-~U_{FkGl$jX-fE5?H

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0a1cad2..8e13223 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,10 +1,23 @@
+# 0.1.30
+
+_23rd October 2020_
+
+### Changed
+
+- Deployed a work around for switching between pre-made microcosms.
+
+### Known Issues
+
+- If you are in a microcosm and use URL scheme to create a new microcosm the data will not refresh until you create a new node or switch routes.
+- iOS router
+
 # 0.1.29
 
 _16th October 2020_
 
 ### Changed
 
-- name is now stored unless cleared meaning you can switch microcosms faster on any device
+- name is now stored unless cleared meaning you can switch microcosms faster on any device.
 
 # 0.1.28
 
diff --git a/app/package.json b/app/package.json
index 99546a9..8c1f107 100644
--- a/app/package.json
+++ b/app/package.json
@@ -1,6 +1,6 @@
 {
   "name": "nodenogg.in",
-  "version": "0.1.28",
+  "version": "0.1.30",
   "private": true,
   "scripts": {
     "serve": "vue-cli-service serve",
diff --git a/app/src/App.vue b/app/src/App.vue
index 5ea0d36..d6dc96e 100644
--- a/app/src/App.vue
+++ b/app/src/App.vue
@@ -1,7 +1,7 @@
 <template>
   <div id="app">
     <navigation />
-    <router-view :key="$route.fullPath"></router-view>
+    <router-view />
   </div>
 </template>
 
diff --git a/app/src/components/OnBoard.vue b/app/src/components/OnBoard.vue
index cb76a8c..71b4193 100644
--- a/app/src/components/OnBoard.vue
+++ b/app/src/components/OnBoard.vue
@@ -1,6 +1,6 @@
 <template>
   <div ref="nodes" class="node">
-    <div v-if="this.currentroute.name == 'Home'">
+    <div v-if="this.currentroute.name == 'Organise'">
       <vue-draggable-resizable
         class="innernode"
         :w="300"
@@ -78,24 +78,25 @@
                 >Create or Rejoin a Microcosm</BaseButton
               >
             </div>
-          </div>
-          <div v-else>
+            <!-- </div> -->
+            <!-- <div v-else> -->
             <h4>Loading...</h4>
           </div>
         </div>
       </vue-draggable-resizable>
     </div>
     <div v-else>
-      <div class="nodes">
+      <div>
+        <vue-draggable-resizable> </vue-draggable-resizable>
         <p id="nodeid" :inner-html.prop="nodetext | marked"></p>
         <div v-if="name == false">
           <input
             type="text"
-            id="clientid"
             v-model.trim="clientid"
             placeholder="name"
             autocorrect="off"
             autocapitalize="none"
+            ref="objectname"
             v-on:keyup.enter="setClient()"
             autofocus
             @focus="editTrue(true)"
@@ -118,18 +119,17 @@
         </div>
       </div>
 
-      <div class="nodes">
+      <div class="content">
         <p id="nodeid" :inner-html.prop="nodetext2 | marked"></p>
         <div v-if="microcosm == false">
           <input
-            id="microcosm"
             type="text"
             v-model.trim="localmicrocosm"
             placeholder="microcosm name"
             autocorrect="off"
-            ref="microcosm"
             autocapitalize="none"
             @focus="editTrue(true)"
+            ref="microcosm"
             @blur="editTrue(false)"
             v-on:keyup.enter="createMicrocosm(), letsGo()"
           />
@@ -141,8 +141,8 @@
               >Create or Rejoin a Microcosm</BaseButton
             >
           </div>
-        </div>
-        <div v-else>
+          <!-- </div> -->
+          <!-- <div v-else> -->
           <h4>Loading...</h4>
         </div>
       </div>
diff --git a/app/src/router/index.js b/app/src/router/index.js
index 4297878..af73514 100644
--- a/app/src/router/index.js
+++ b/app/src/router/index.js
@@ -1,8 +1,8 @@
 import Vue from 'vue'
 import VueRouter from 'vue-router'
+import List from '../views/List.vue'
 import Home from '../views/Home.vue'
 import Cards from '../views/Cards.vue'
-import List from '../views/List.vue'
 import Discarded from '../views/Discarded.vue'
 import Leave from '../views/Leave.vue'
 import About from '../views/About.vue'
@@ -69,5 +69,4 @@ const router = new VueRouter({
   routes,
 })
 
-
 export default router
diff --git a/app/src/store/index.js b/app/src/store/index.js
index 709d16d..0d829d3 100644
--- a/app/src/store/index.js
+++ b/app/src/store/index.js
@@ -173,6 +173,7 @@ const store = new Vuex.Store({
         })
         .catch(function (err) {
           if (err.status == 404) {
+            var startup = '777'
             // var uniqueid =
             //   Math.random().toString(36).substring(2, 15) +
             //   Math.random().toString(36).substring(2, 15)
@@ -180,17 +181,17 @@ const store = new Vuex.Store({
               _id: state.myclient,
               _attachments: {},
               nodes: [
-                // {
-                //   // FIXME: these values are here as GET_ALL_NODES cant hunt a blank
-                //   // this shouldnt need to be here though
-                //   node_id: uniqueid,
-                //   node_text: 'Ignore this node ' + state.myclient,
-                //   node_owner: state.myclient,
-                //   content_type: 'sheet',
-                //   // NOTE: the first node is hidden due to a position not being created
-                //   deleted: true,
-                //   attachment_name: '',
-                // },
+                {
+                  // FIXME: these values are here as GET_ALL_NODES cant hunt a blank
+                  // this shouldnt need to be here though
+                  node_id: startup,
+                  node_text:
+                    '## Welcome \n This node was automatically by the system as a workaround for an iOS and URL routing bug, just ignore for now please \n ## 🤦🏻‍♂️',
+                  node_owner: state.myclient,
+                  content_type: 'sheet',
+                  // NOTE: the first node is also hidden due to a position not being created
+                  deleted: true,
+                },
               ],
             })
           }
diff --git a/app/src/views/Cards.vue b/app/src/views/Cards.vue
index 2d35f60..0f7d3cb 100644
--- a/app/src/views/Cards.vue
+++ b/app/src/views/Cards.vue
@@ -30,24 +30,6 @@
     </div>
 
     <div v-else>
-      <div v-if="this.currentroute.name == 'Home'">
-        <OtherNodeslayer
-          v-for="value in otherNodes"
-          v-bind:key="value.node_id"
-          v-bind:nodeid="value.node_id"
-          v-bind:nodetext="value.node_text"
-          v-bind:deleted="value.deleted"
-        />
-        <!-- </div> -->
-        <NodesLayer
-          @editTrue="(e) => editTrue(e)"
-          v-for="value in myNodes"
-          v-bind:key="value.node_id"
-          v-bind:nodeid="value.node_id"
-          v-bind:nodetext="value.node_text"
-          v-bind:deleted="value.deleted"
-        />
-      </div>
       <OnBoard @clientAdded="clientAdded()" @editTrue="(e) => editTrue(e)" />
     </div>
   </div>
@@ -58,8 +40,6 @@ import Router from '@/router'
 import CardsLayer from '@/components/CardsLayer'
 import OtherCardslayer from '@/components/OtherCardslayer'
 import OnBoard from '@/components/OnBoard'
-import NodesLayer from '@/components/NodesLayer'
-import OtherNodeslayer from '@/components/OtherNodeslayer'
 
 import { mapState } from 'vuex'
 
@@ -121,8 +101,6 @@ export default {
     OtherCardslayer,
 
     OnBoard,
-    OtherNodeslayer,
-    NodesLayer,
   },
 }
 </script>
diff --git a/app/src/views/Discarded.vue b/app/src/views/Discarded.vue
index 553dfdf..0b4db4d 100644
--- a/app/src/views/Discarded.vue
+++ b/app/src/views/Discarded.vue
@@ -13,24 +13,6 @@
     </div>
 
     <div v-else>
-      <div v-if="this.currentroute.name == 'Home'">
-        <OtherNodeslayer
-          v-for="value in otherNodes"
-          v-bind:key="value.node_id"
-          v-bind:nodeid="value.node_id"
-          v-bind:nodetext="value.node_text"
-          v-bind:deleted="value.deleted"
-        />
-        <!-- </div> -->
-        <NodesLayer
-          @editTrue="(e) => editTrue(e)"
-          v-for="value in myNodes"
-          v-bind:key="value.node_id"
-          v-bind:nodeid="value.node_id"
-          v-bind:nodetext="value.node_text"
-          v-bind:deleted="value.deleted"
-        />
-      </div>
       <OnBoard @clientAdded="clientAdded()" @editTrue="(e) => editTrue(e)" />
     </div>
   </div>
@@ -40,8 +22,7 @@
 import Router from '@/router'
 import DiscardLayer from '@/components/DiscardLayer'
 import OnBoard from '@/components/OnBoard'
-import NodesLayer from '@/components/NodesLayer'
-import OtherNodeslayer from '@/components/OtherNodeslayer'
+
 import { mapState } from 'vuex'
 
 import { shortcutsMixin } from '@/components/mixins/shortcutsMixin.js'
@@ -66,7 +47,7 @@ export default {
   computed: {
     ...mapState({
       myNodes: (state) => state.myNodes,
-      otherNodes: (state) => state.otherNodes,
+
       shortcutstate: (state) => state.shortcutstate,
       toolmode: (state) => state.ui.mode,
     }),
@@ -96,8 +77,6 @@ export default {
   components: {
     DiscardLayer,
     OnBoard,
-    NodesLayer,
-    OtherNodeslayer,
   },
 }
 </script>
diff --git a/app/src/views/Home.vue b/app/src/views/Home.vue
index 54e8680..49efc2e 100644
--- a/app/src/views/Home.vue
+++ b/app/src/views/Home.vue
@@ -129,7 +129,7 @@ export default {
       width: 2000,
       height: 2000,
       clientset: false,
-      listview: false,
+      // listview: false,
       offline: false,
       uploadready: false,
       copyready: false,
@@ -164,6 +164,7 @@ export default {
   mounted() {
     window.addEventListener('resize', this.handleResize)
     this.handleResize()
+    console.log(this.clientset)
   },
 
   created() {
diff --git a/app/src/views/List-old.vue b/app/src/views/List-old.vue
new file mode 100644
index 0000000..829f8fc
--- /dev/null
+++ b/app/src/views/List-old.vue
@@ -0,0 +1,100 @@
+<template>
+  <div>
+    <div v-if="clientset">
+      <div id="listwrapper">
+        <h1 class="mobile">Your nodes - collect</h1>
+        <ListLayer
+          @editTrue="(e) => editTrue(e)"
+          v-for="value in myNodes"
+          v-bind:key="value.node_id"
+          v-bind:nodeid="value.node_id"
+          v-bind:nodetext="value.node_text"
+          v-bind:deleted="value.deleted"
+        />
+        <!-- <div class="btn-row">
+          <BaseButton class="new" buttonClass="action" @click="addNode()"
+            >Create Node</BaseButton
+          >
+        </div> -->
+      </div>
+    </div>
+    <div v-else>
+      <OnBoard @clientAdded="clientAdded()" @editTrue="(e) => editTrue(e)" />
+    </div>
+  </div>
+</template>
+
+<script>
+import ListLayer from '@/components/ListLayer'
+import OnBoard from '@/components/OnBoard'
+
+import { mapState } from 'vuex'
+
+//import { shortcutsMixin } from '@/components/mixins/shortcutsMixin.js'
+
+export default {
+  name: 'List',
+
+  //mixins: [shortcutsMixin],
+  data: function () {
+    return {
+      clientset: false,
+    }
+  },
+
+  props: {
+    nodeid: String,
+    nodetext: String,
+    deleted: Boolean,
+  },
+
+  computed: {
+    ...mapState({
+      myNodes: (state) => state.myNodes,
+      //otherNodes: (state) => state.otherNodes,
+      // shortcutstate: (state) => state.shortcutstate,
+      // toolmode: (state) => state.ui.mode,
+    }),
+  },
+
+  // created() {
+  //   if (typeof window !== 'undefined') {
+  //     document.addEventListener('keydown', this.handleKeyPress)
+  //   }
+  // },
+
+  // beforeDestroy() {
+  //   if (typeof window !== 'undefined') {
+  //     document.removeEventListener('keydown', this.handleKeyPress)
+  //   }
+  // },
+
+  methods: {
+    clientAdded() {
+      this.clientset = !this.clientset
+    },
+
+    addNode() {
+      this.$store.dispatch('addNode')
+    },
+
+    editTrue(e) {
+      this.$store.dispatch('shortcutState', e)
+    },
+  },
+  components: {
+    ListLayer,
+    OnBoard,
+  },
+}
+</script>
+
+<style lang="css" scoped>
+.mobile {
+  margin-left: 1em;
+  font-size: 1em;
+}
+.new {
+  margin-bottom: 1em;
+}
+</style>
diff --git a/app/src/views/List.vue b/app/src/views/List.vue
index 3551422..8099dab 100644
--- a/app/src/views/List.vue
+++ b/app/src/views/List.vue
@@ -2,7 +2,7 @@
   <div>
     <div v-if="clientset">
       <div id="listwrapper">
-        <h1 class="mobile">Your nodes - list mode</h1>
+        <h1 class="mobile">Your nodes - collect</h1>
         <ListLayer
           @editTrue="(e) => editTrue(e)"
           v-for="value in myNodes"
@@ -19,36 +19,15 @@
       </div>
     </div>
     <div v-else>
-      <div v-if="this.currentroute.name == 'Home'">
-        <OtherNodeslayer
-          v-for="value in otherNodes"
-          v-bind:key="value.node_id"
-          v-bind:nodeid="value.node_id"
-          v-bind:nodetext="value.node_text"
-          v-bind:deleted="value.deleted"
-        />
-        <!-- </div> -->
-        <NodesLayer
-          @editTrue="(e) => editTrue(e)"
-          v-for="value in myNodes"
-          v-bind:key="value.node_id"
-          v-bind:nodeid="value.node_id"
-          v-bind:nodetext="value.node_text"
-          v-bind:deleted="value.deleted"
-        />
-      </div>
-
       <OnBoard @clientAdded="clientAdded()" @editTrue="(e) => editTrue(e)" />
     </div>
   </div>
 </template>
 
 <script>
-import Router from '@/router'
 import ListLayer from '@/components/ListLayer'
+
 import OnBoard from '@/components/OnBoard'
-import NodesLayer from '@/components/NodesLayer'
-import OtherNodeslayer from '@/components/OtherNodeslayer'
 
 import { mapState } from 'vuex'
 
@@ -60,7 +39,6 @@ export default {
   mixins: [shortcutsMixin],
   data: function () {
     return {
-      currentroute: Router.currentRoute,
       clientset: false,
     }
   },
@@ -74,9 +52,9 @@ export default {
   computed: {
     ...mapState({
       myNodes: (state) => state.myNodes,
-      otherNodes: (state) => state.otherNodes,
-      shortcutstate: (state) => state.shortcutstate,
-      toolmode: (state) => state.ui.mode,
+      //otherNodes: (state) => state.otherNodes,
+      // shortcutstate: (state) => state.shortcutstate,
+      // toolmode: (state) => state.ui.mode,
     }),
   },
 
@@ -86,6 +64,10 @@ export default {
     }
   },
 
+  mounted() {
+    console.log(this.clientset)
+  },
+
   beforeDestroy() {
     if (typeof window !== 'undefined') {
       document.removeEventListener('keydown', this.handleKeyPress)
@@ -108,8 +90,6 @@ export default {
   components: {
     ListLayer,
     OnBoard,
-    OtherNodeslayer,
-    NodesLayer,
   },
 }
 </script>
-- 
GitLab