about summary refs log tree commit diff
path: root/src/state/models/navigation.ts
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2022-11-14 16:56:40 -0600
committerPaul Frazee <pfrazee@gmail.com>2022-11-14 16:56:40 -0600
commit723dee5704b4e5c9f51d4311752eced07e7f135f (patch)
treee7567e0af880b53b68e0095e3d0dd93eadf75a4a /src/state/models/navigation.ts
parentc98edca116b1a7fc437c08a614b0a8d648b4bd40 (diff)
downloadvoidsky-723dee5704b4e5c9f51d4311752eced07e7f135f.tar.zst
Disable storing nav state due to bugs
Diffstat (limited to 'src/state/models/navigation.ts')
-rw-r--r--src/state/models/navigation.ts67
1 files changed, 34 insertions, 33 deletions
diff --git a/src/state/models/navigation.ts b/src/state/models/navigation.ts
index 2b30bc62b..096f35335 100644
--- a/src/state/models/navigation.ts
+++ b/src/state/models/navigation.ts
@@ -123,37 +123,36 @@ export class NavigationTabModel {
   }
 
   hydrate(v: unknown) {
-    this.history = []
-    this.index = 0
-    if (isObj(v)) {
-      if (hasProp(v, 'history') && Array.isArray(v.history)) {
-        for (const item of v.history) {
-          if (
-            isObj(item) &&
-            hasProp(item, 'url') &&
-            typeof item.url === 'string'
-          ) {
-            let copy: HistoryItem = {
-              url: item.url,
-              ts:
-                hasProp(item, 'ts') && typeof item.ts === 'number'
-                  ? item.ts
-                  : Date.now(),
-            }
-            if (hasProp(item, 'title') && typeof item.title === 'string') {
-              copy.title = item.title
-            }
-            this.history.push(copy)
-          }
-        }
-      }
-      if (hasProp(v, 'index') && typeof v.index === 'number') {
-        this.index = v.index
-      }
-      if (this.index >= this.history.length - 1) {
-        this.index = this.history.length - 1
-      }
-    }
+    // TODO fixme
+    // if (isObj(v)) {
+    //   if (hasProp(v, 'history') && Array.isArray(v.history)) {
+    //     for (const item of v.history) {
+    //       if (
+    //         isObj(item) &&
+    //         hasProp(item, 'url') &&
+    //         typeof item.url === 'string'
+    //       ) {
+    //         let copy: HistoryItem = {
+    //           url: item.url,
+    //           ts:
+    //             hasProp(item, 'ts') && typeof item.ts === 'number'
+    //               ? item.ts
+    //               : Date.now(),
+    //         }
+    //         if (hasProp(item, 'title') && typeof item.title === 'string') {
+    //           copy.title = item.title
+    //         }
+    //         this.history.push(copy)
+    //       }
+    //     }
+    //   }
+    //   if (hasProp(v, 'index') && typeof v.index === 'number') {
+    //     this.index = v.index
+    //   }
+    //   if (this.index >= this.history.length - 1) {
+    //     this.index = this.history.length - 1
+    //   }
+    // }
   }
 }
 
@@ -236,7 +235,9 @@ export class NavigationModel {
   }
 
   hydrate(v: unknown) {
-    if (isObj(v)) {
+    // TODO fixme
+    this.clear()
+    /*if (isObj(v)) {
       if (hasProp(v, 'tabs') && Array.isArray(v.tabs)) {
         for (const tab of v.tabs) {
           const copy = new NavigationTabModel()
@@ -249,6 +250,6 @@ export class NavigationModel {
       if (hasProp(v, 'tabIndex') && typeof v.tabIndex === 'number') {
         this.tabIndex = v.tabIndex
       }
-    }
+    }*/
   }
 }