Browse Source

fix top warnings when on prod or non-prod servers

pull/100/head
Trent Larson 11 months ago
parent
commit
d0697c1ef4
  1. 10
      src/components/TopMessage.vue
  2. 3
      src/constants/app.ts
  3. 2
      src/views/AccountViewView.vue

10
src/components/TopMessage.vue

@ -30,15 +30,15 @@ export default class TopMessage extends Vue {
const settings = await db.settings.get(MASTER_SETTINGS_KEY);
if (
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);
this.message = "You're linked to a test server, user " + didPrefix;
const didPrefix = settings.activeDid?.slice(11, 15);
this.message = "You're linked to a non-prod server, user " + didPrefix;
} else if (
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 =
"You're linked to the production server, user " + didPrefix;
}

3
src/constants/app.ts

@ -6,9 +6,6 @@
export enum AppString {
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",
TEST_ENDORSER_API_SERVER = "https://test-api.endorser.ch",
LOCAL_ENDORSER_API_SERVER = "http://localhost:3000",

2
src/views/AccountViewView.vue

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

Loading…
Cancel
Save