about summary refs log tree commit diff
path: root/src/state
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2022-11-21 18:55:08 -0600
committerPaul Frazee <pfrazee@gmail.com>2022-11-21 18:55:08 -0600
commite858bb52de180645bba4f5ffa2f8bc0cfe8ad1fe (patch)
tree120b5be2ed657b7f8d30d56016d1a0857bb98086 /src/state
parentb2dba9a15b0b27c9221808ff037090c2b4c2d500 (diff)
parent7e487fd5ae053ebb4373b85f1b3d7aa66f8a0241 (diff)
downloadvoidsky-e858bb52de180645bba4f5ffa2f8bc0cfe8ad1fe.tar.zst
Merge branch 'simplify' into main
Diffstat (limited to 'src/state')
-rw-r--r--src/state/index.ts1
-rw-r--r--src/state/models/navigation.ts11
2 files changed, 10 insertions, 2 deletions
diff --git a/src/state/index.ts b/src/state/index.ts
index 7bb757757..32efea3f3 100644
--- a/src/state/index.ts
+++ b/src/state/index.ts
@@ -5,7 +5,6 @@ import {RootStoreModel} from './models/root-store'
 import * as libapi from './lib/api'
 import * as storage from './lib/storage'
 
-export const IS_PROD_BUILD = true
 export const LOCAL_DEV_SERVICE = 'http://localhost:2583'
 export const STAGING_SERVICE = 'https://pds.staging.bsky.dev'
 export const PROD_SERVICE = 'https://bsky.social'
diff --git a/src/state/models/navigation.ts b/src/state/models/navigation.ts
index a4d7d443b..1e639b0f3 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() {
@@ -244,6 +244,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
@@ -252,10 +255,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),