about summary refs log tree commit diff
path: root/src/state
diff options
context:
space:
mode:
Diffstat (limited to 'src/state')
-rw-r--r--src/state/index.ts14
-rw-r--r--src/state/models/shell-ui.ts15
2 files changed, 20 insertions, 9 deletions
diff --git a/src/state/index.ts b/src/state/index.ts
index a886e7611..b16b51648 100644
--- a/src/state/index.ts
+++ b/src/state/index.ts
@@ -3,14 +3,12 @@ import {sessionClient as AtpApi} from '../third-party/api'
 import {RootStoreModel} from './models/root-store'
 import * as libapi from './lib/api'
 import * as storage from './lib/storage'
-import {BUILD} from '../env'
-
-export const DEFAULT_SERVICE =
-  BUILD === 'prod'
-    ? 'http://localhost:2583' // TODO
-    : BUILD === 'staging'
-    ? 'https://pds.staging.bsky.dev' // TODO
-    : 'http://localhost:2583'
+
+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://plc.bsky.social'
+export const DEFAULT_SERVICE = IS_PROD_BUILD ? PROD_SERVICE : LOCAL_DEV_SERVICE
 const ROOT_STATE_STORAGE_KEY = 'root'
 const STATE_FETCH_INTERVAL = 15e3
 
diff --git a/src/state/models/shell-ui.ts b/src/state/models/shell-ui.ts
index cc884f1c3..73b1bd56e 100644
--- a/src/state/models/shell-ui.ts
+++ b/src/state/models/shell-ui.ts
@@ -66,6 +66,17 @@ export class InviteToSceneModel {
   }
 }
 
+export class ServerInputModel {
+  name = 'server-input'
+
+  constructor(
+    public initialService: string,
+    public onSelect: (url: string) => void,
+  ) {
+    makeAutoObservable(this)
+  }
+}
+
 export interface ComposerOpts {
   replyTo?: Post.PostRef
   onPost?: () => void
@@ -79,6 +90,7 @@ export class ShellUiModel {
     | SharePostModel
     | EditProfileModel
     | CreateSceneModel
+    | ServerInputModel
     | undefined
   isComposerActive = false
   composerOpts: ComposerOpts | undefined
@@ -93,7 +105,8 @@ export class ShellUiModel {
       | ConfirmModel
       | SharePostModel
       | EditProfileModel
-      | CreateSceneModel,
+      | CreateSceneModel
+      | ServerInputModel,
   ) {
     this.isModalActive = true
     this.activeModal = modal