about summary refs log tree commit diff
path: root/src/state
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2022-11-20 12:00:40 -0600
committerPaul Frazee <pfrazee@gmail.com>2022-11-20 12:00:40 -0600
commita21bcf10dd794b69009b98c7789a7e87d696bfef (patch)
tree544929e06cfd3643b6cfe300b03186831f1ae13e /src/state
parent63348807b59ec82a905aa2a1164a1484e61aa29a (diff)
downloadvoidsky-a21bcf10dd794b69009b98c7789a7e87d696bfef.tar.zst
Add build flags and disable tabs for now
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 fd81bc842..872cd69f6 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 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),