diff --git a/native/account/siwe-panel.react.js b/native/account/siwe-panel.react.js --- a/native/account/siwe-panel.react.js +++ b/native/account/siwe-panel.react.js @@ -19,10 +19,10 @@ import { NavContext } from '../navigation/navigation-context'; import { useSelector } from '../redux/redux-utils'; import { nativeLogInExtraInfoSelector } from '../selectors/account-selectors'; +import { defaultLandingURLPrefix } from '../utils/url-utils'; import { setNativeCredentials } from './native-credentials'; -const commSIWE = __DEV__ - ? 'http://localhost/commlanding/siwe' - : 'https://comm.app/siwe'; + +const commSIWE = `${defaultLandingURLPrefix}/siwe`; type BaseProps = { +setActiveAlert: (activeAlert: boolean) => void, diff --git a/native/utils/url-utils.js b/native/utils/url-utils.js --- a/native/utils/url-utils.js +++ b/native/utils/url-utils.js @@ -10,6 +10,7 @@ const localhostHostnameFromAndroidEmulator = '10.0.2.2'; const productionNodeServerURL = 'https://squadcal.org'; +const productionLandingURL = 'https://comm.app'; const devIsEmulator: boolean = __DEV__ && DeviceInfo.isEmulatorSync(); function getDevServerHostname(): string { @@ -29,12 +30,22 @@ return `http://${hostname}/comm`; } +function getLandingURLFromHostname(hostname: string): string { + return `http://${hostname}/commlanding`; +} + function getDevNodeServerURL(): string { invariant(__DEV__, 'getDevNodeServerURL called from production'); const hostname = getDevServerHostname(); return getDevNodeServerURLFromHostname(hostname); } +function getDevLandingURL(): string { + invariant(__DEV__, 'getDevLandingURL called from production'); + const hostname = getDevServerHostname(); + return getLandingURLFromHostname(hostname); +} + const nodeServerOptions = [productionNodeServerURL]; if (Platform.OS === 'android') { nodeServerOptions.push( @@ -48,12 +59,17 @@ ? getDevNodeServerURL() : productionNodeServerURL; +const defaultLandingURLPrefix: string = __DEV__ + ? getDevLandingURL() + : productionLandingURL; + const natNodeServer: string = getDevNodeServerURLFromHostname(natDevHostname); const setCustomServer = 'SET_CUSTOM_SERVER'; export { defaultURLPrefix, + defaultLandingURLPrefix, getDevServerHostname, nodeServerOptions, natNodeServer,