Browse Source

fix logic for prod & test host detection

claim-view-improvements
Trent Larson 11 months ago
parent
commit
5534f8fa50
  1. 2
      README.md
  2. 4
      src/components/TopMessage.vue
  3. 3
      src/constants/app.ts

2
README.md

@ -34,7 +34,7 @@ If you are deploying in a subdirectory, add it to `publicPath` in vue.config.js,
* `npm run build`
* Revert src/constants/app.ts & change version to "-beta"
* Revert src/constants/app.ts
* `cp sw_scripts/[ns]* dist/`

4
src/components/TopMessage.vue

@ -30,13 +30,13 @@ 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
window.location.hostname !== AppString.PROD_TIME_SAFARI_SERVER_HOST
) {
const didPrefix = settings.activeDid?.slice(11, 14);
this.message = "You're linked to a test server, user " + didPrefix;
} else if (
settings?.warnIfProdServer &&
window.location.hostname === AppString.PROD_TIME_SAFARI_SERVER
window.location.hostname === AppString.PROD_TIME_SAFARI_SERVER_HOST
) {
const didPrefix = settings.activeDid?.slice(1, 14);
this.message =

3
src/constants/app.ts

@ -6,7 +6,8 @@
export enum AppString {
APP_NAME = "Time Safari",
PROD_TIME_SAFARI_SERVER = "https://timesafari.app",
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",

Loading…
Cancel
Save