diff --git a/public/config.js b/public/config.js index 1d64bd27..d7b1b129 100644 --- a/public/config.js +++ b/public/config.js @@ -1,6 +1,3 @@ let CONFIG = { -// Uncomment below lines to provide runtime configuration. -// APP_NAME: "Logion Wallet", -// directory: "http://localhost:8090/api", -// rpcEndpoints: [ "ws://localhost:9944" ] + // See `ConfigType` }; diff --git a/src/PublicPaths.tsx b/src/PublicPaths.tsx index 1bc53c88..f62807eb 100644 --- a/src/PublicPaths.tsx +++ b/src/PublicPaths.tsx @@ -1,4 +1,5 @@ import { UUID, Hash } from "@logion/node-api"; +import config from "src/config"; export const PUBLIC_PATH = "/public"; export const CERTIFICATE_RELATIVE_PATH = "/certificate/:locId"; @@ -49,7 +50,7 @@ export function fullTokensRecordsCertificate(locId: UUID, recordId: Hash, noRedi } export function getBaseUrl(): string { - return `${ window.location.protocol }//${ window.location.host }`; + return config.baseUrl || `${ window.location.protocol }//${ window.location.host }`; } export const SECRET_RECOVERY_RELATIVE_PATH = "/secret-recovery"; diff --git a/src/config/index.tsx b/src/config/index.tsx index 585da260..3d810fe7 100644 --- a/src/config/index.tsx +++ b/src/config/index.tsx @@ -3,21 +3,21 @@ import { EnvironmentString } from "@logion/client"; export interface ConfigType { environment: EnvironmentString | undefined, APP_NAME: string, - directory: string, rpcEndpoints: string[], crossmintApiKey: string, logionClassification: string, creativeCommons: string, + baseUrl: string | undefined, } export const DEFAULT_CONFIG: ConfigType = { environment: undefined, APP_NAME: "Logion Wallet", - directory: "", rpcEndpoints: [], crossmintApiKey: "", logionClassification: "", creativeCommons: "", + baseUrl: undefined, }; export interface EnvConfigType extends Record {