fix top warnings when on prod or non-prod servers

This commit is contained in:
2023-12-18 16:06:55 -07:00
parent 1dd2333624
commit d0697c1ef4
3 changed files with 6 additions and 9 deletions

View File

@@ -30,15 +30,15 @@ export default class TopMessage extends Vue {
const settings = await db.settings.get(MASTER_SETTINGS_KEY); const settings = await db.settings.get(MASTER_SETTINGS_KEY);
if ( if (
settings?.warnIfTestServer && settings?.warnIfTestServer &&
window.location.hostname !== AppString.PROD_TIME_SAFARI_SERVER_HOST settings.apiServer !== AppString.PROD_ENDORSER_API_SERVER
) { ) {
const didPrefix = settings.activeDid?.slice(11, 14); const didPrefix = settings.activeDid?.slice(11, 15);
this.message = "You're linked to a test server, user " + didPrefix; this.message = "You're linked to a non-prod server, user " + didPrefix;
} else if ( } else if (
settings?.warnIfProdServer && settings?.warnIfProdServer &&
window.location.hostname === AppString.PROD_TIME_SAFARI_SERVER_HOST settings.apiServer === AppString.PROD_ENDORSER_API_SERVER
) { ) {
const didPrefix = settings.activeDid?.slice(1, 14); const didPrefix = settings.activeDid?.slice(11, 15);
this.message = this.message =
"You're linked to the production server, user " + didPrefix; "You're linked to the production server, user " + didPrefix;
} }

View File

@@ -6,9 +6,6 @@
export enum AppString { export enum AppString {
APP_NAME = "Time Safari", APP_NAME = "Time Safari",
PROD_TIME_SAFARI_SERVER_HOST = "timesafari.app",
PROD_TIME_SAFARI_SERVER = "https://" + PROD_TIME_SAFARI_SERVER_HOST,
PROD_ENDORSER_API_SERVER = "https://api.endorser.ch", PROD_ENDORSER_API_SERVER = "https://api.endorser.ch",
TEST_ENDORSER_API_SERVER = "https://test-api.endorser.ch", TEST_ENDORSER_API_SERVER = "https://test-api.endorser.ch",
LOCAL_ENDORSER_API_SERVER = "http://localhost:3000", LOCAL_ENDORSER_API_SERVER = "http://localhost:3000",

View File

@@ -390,7 +390,7 @@
@click="toggleTestWarning" @click="toggleTestWarning"
> >
<!-- label --> <!-- label -->
<h2>Show warning if on test server</h2> <h2>Show warning if on non-prod server</h2>
<!-- toggle --> <!-- toggle -->
<div class="relative ml-2"> <div class="relative ml-2">
<!-- input --> <!-- input -->