From 3bf8fd0c220200a829ce3b5020bece31d4eb6a45 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Sat, 2 Dec 2023 15:28:32 -0700 Subject: [PATCH] rename "push" to "webPush" for future-proofing --- src/App.vue | 4 ++-- src/db/index.ts | 2 +- src/db/tables/settings.ts | 2 +- src/views/AccountViewView.vue | 22 +++++++++++----------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/App.vue b/src/App.vue index 188f689..2486884 100644 --- a/src/App.vue +++ b/src/App.vue @@ -285,8 +285,8 @@ export default class App extends Vue { await db.open(); const settings = await db.settings.get(MASTER_SETTINGS_KEY); let pushUrl: string = AppString.DEFAULT_PUSH_SERVER; - if (settings?.pushServer) { - pushUrl = settings.pushServer; + if (settings?.webPushServer) { + pushUrl = settings.webPushServer; } await axios.get(pushUrl + "/web-push/vapid").then((response) => { diff --git a/src/db/index.ts b/src/db/index.ts index ea8556c..16c99d8 100644 --- a/src/db/index.ts +++ b/src/db/index.ts @@ -47,6 +47,6 @@ db.on("populate", () => { apiServer: AppString.DEFAULT_ENDORSER_API_SERVER, // remember that things you add from now on aren't automatically in the DB for old users - pushServer: AppString.DEFAULT_PUSH_SERVER, + webPushServer: AppString.DEFAULT_PUSH_SERVER, }); }); diff --git a/src/db/tables/settings.ts b/src/db/tables/settings.ts index 20c378e..0b7960c 100644 --- a/src/db/tables/settings.ts +++ b/src/db/tables/settings.ts @@ -20,7 +20,7 @@ export type Settings = { lastViewedClaimId?: string; // Last viewed claim ID lastNotifiedClaimId?: string; // Last notified claim ID isRegistered?: boolean; - pushServer?: string; // Push server URL + webPushServer?: string; // Web Push server URL // Array of named search boxes defined by bounding boxes searchBoxes?: Array<{ diff --git a/src/views/AccountViewView.vue b/src/views/AccountViewView.vue index 9bd7c73..9e29080 100644 --- a/src/views/AccountViewView.vue +++ b/src/views/AccountViewView.vue @@ -349,10 +349,10 @@ @@ -427,8 +427,8 @@ export default class AccountViewView extends Vue { numAccounts = 0; publicHex = ""; publicBase64 = ""; - pushServer = ""; - pushServerInput = ""; + webPushServer = ""; + webPushServerInput = ""; limits: RateLimits | null = null; limitsMessage = ""; loadingLimits = true; // might as well now that we do it on mount, to avoid flashing the registration message @@ -553,8 +553,8 @@ export default class AccountViewView extends Vue { (settings?.firstName || "") + (settings?.lastName ? ` ${settings.lastName}` : ""); // pre v 0.1.3 this.isRegistered = !!settings?.isRegistered; - this.pushServer = (settings?.pushServer as string) || ""; - this.pushServerInput = (settings?.pushServer as string) || ""; + this.webPushServer = (settings?.webPushServer as string) || ""; + this.webPushServerInput = (settings?.webPushServer as string) || ""; this.showContactGives = !!settings?.showContactGivesInline; } @@ -886,9 +886,9 @@ export default class AccountViewView extends Vue { async onClickSavePushServer() { await db.open(); db.settings.update(MASTER_SETTINGS_KEY, { - pushServer: this.pushServerInput, + webPushServer: this.webPushServerInput, }); - this.pushServer = this.pushServerInput; + this.webPushServer = this.webPushServerInput; } }