From a21bcf10dd794b69009b98c7789a7e87d696bfef Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Sun, 20 Nov 2022 12:00:40 -0600 Subject: Add build flags and disable tabs for now --- src/state/models/navigation.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/state/models/navigation.ts') diff --git a/src/state/models/navigation.ts b/src/state/models/navigation.ts index 0ec097afc..758ae37d8 100644 --- a/src/state/models/navigation.ts +++ b/src/state/models/navigation.ts @@ -1,5 +1,5 @@ import {makeAutoObservable} from 'mobx' -import {isObj, hasProp} from '../lib/type-guards' +import {TABS_ENABLED} from '../../build-flags' let __id = 0 function genId() { @@ -226,6 +226,9 @@ export class NavigationModel { // = newTab(url: string, title?: string) { + if (!TABS_ENABLED) { + return this.navigate(url) + } const tab = new NavigationTabModel() tab.navigate(url, title) tab.isNewTab = true @@ -234,10 +237,16 @@ export class NavigationModel { } setActiveTab(tabIndex: number) { + if (!TABS_ENABLED) { + return + } this.tabIndex = Math.max(Math.min(tabIndex, this.tabs.length - 1), 0) } closeTab(tabIndex: number) { + if (!TABS_ENABLED) { + return + } this.tabs = [ ...this.tabs.slice(0, tabIndex), ...this.tabs.slice(tabIndex + 1), -- cgit 1.4.1