From 723dee5704b4e5c9f51d4311752eced07e7f135f Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Mon, 14 Nov 2022 16:56:40 -0600 Subject: [PATCH] Disable storing nav state due to bugs --- src/state/models/navigation.ts | 67 +++++++++++++++++----------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/src/state/models/navigation.ts b/src/state/models/navigation.ts index 2b30bc62..096f3533 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 } - } + }*/ } }