We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6145446 commit a247646Copy full SHA for a247646
apps/sim/lib/core/config/feature-flags.ts
@@ -22,14 +22,9 @@ export const isTest = env.NODE_ENV === 'test'
22
* Is this the hosted version of the application.
23
* True for sim.ai and any subdomain of sim.ai (e.g. staging.sim.ai, dev.sim.ai).
24
*/
25
-export const isHosted = (() => {
26
- try {
27
- const hostname = new URL(getEnv('NEXT_PUBLIC_APP_URL') || '').hostname
28
- return hostname === 'sim.ai' || hostname.endsWith('.sim.ai')
29
- } catch {
30
- return false
31
- }
32
-})()
+const appUrl = getEnv('NEXT_PUBLIC_APP_URL')
+const appHostname = appUrl ? new URL(appUrl).hostname : ''
+export const isHosted = appHostname === 'sim.ai' || appHostname.endsWith('.sim.ai')
33
34
/**
35
* Is billing enforcement enabled
0 commit comments