From 03f135e18069bac342697483124db8a2c3f10559 Mon Sep 17 00:00:00 2001 From: Hunter Miller Date: Mon, 23 Oct 2023 15:36:47 -0500 Subject: [PATCH 1/2] utils: dont require dev for hosted --- ui/src/logic/utils.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ui/src/logic/utils.ts b/ui/src/logic/utils.ts index 59f0ec9d..f07043fb 100644 --- a/ui/src/logic/utils.ts +++ b/ui/src/logic/utils.ts @@ -15,8 +15,25 @@ import { useCallback, useState } from 'react'; export const useMockData = import.meta.env.MODE === 'mock'; +<<<<<<< Updated upstream export const isHosted = import.meta.env.DEV || window.location.hostname.endsWith('.tlon.network'); +======= +export const isStagingHosted = + import.meta.env.DEV || + import.meta.env.VITE_SHIP_URL.endsWith('.test.tlon.systems') || + window.location.hostname.endsWith('.test.tlon.systems'); +export const isHosted = + isStagingHosted || + import.meta.env.VITE_SHIP_URL.endsWith('.tlon.network') || + window.location.hostname.endsWith('.tlon.network'); + +export const hostingUploadURL = isStagingHosted + ? 'https://memex.test.tlon.systems' + : isHosted + ? 'https://memex.tlon.network' + : ''; +>>>>>>> Stashed changes export async function fakeRequest(data: T, time = 300): Promise { return new Promise((resolve) => { From 4b92f52d8b3cc4d9814d6ce9347287a8ee7a84e8 Mon Sep 17 00:00:00 2001 From: Hunter Miller Date: Mon, 23 Oct 2023 15:36:47 -0500 Subject: [PATCH 2/2] utils: dont require dev for hosted --- ui/src/logic/utils.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ui/src/logic/utils.ts b/ui/src/logic/utils.ts index 59f0ec9d..561ad514 100644 --- a/ui/src/logic/utils.ts +++ b/ui/src/logic/utils.ts @@ -15,8 +15,20 @@ import { useCallback, useState } from 'react'; export const useMockData = import.meta.env.MODE === 'mock'; +export const isStagingHosted = + import.meta.env.DEV || + import.meta.env.VITE_SHIP_URL.endsWith('.test.tlon.systems') || + window.location.hostname.endsWith('.test.tlon.systems'); export const isHosted = - import.meta.env.DEV || window.location.hostname.endsWith('.tlon.network'); + isStagingHosted || + import.meta.env.VITE_SHIP_URL.endsWith('.tlon.network') || + window.location.hostname.endsWith('.tlon.network'); + +export const hostingUploadURL = isStagingHosted + ? 'https://memex.test.tlon.systems' + : isHosted + ? 'https://memex.tlon.network' + : ''; export async function fakeRequest(data: T, time = 300): Promise { return new Promise((resolve) => {