A couple small fixes, plus a merge from master #1

Merged
jsnbuchanan merged 45 commits from trentlarson/crowd-funder-from-jason:feat/vitejs-trent into feat/vitejs 2024-04-07 17:52:43 +00:00
Showing only changes of commit 2ae165d56f - Show all commits
+5
View File
@@ -340,11 +340,15 @@ export default class App extends Vue {
pushUrl = settings.webPushServer; pushUrl = settings.webPushServer;
} }
if (pushUrl.startsWith("http://localhost")) {
console.log("Not checking for VAPID in this local environment.");
} else {
await axios await axios
.get(pushUrl + "/web-push/vapid") .get(pushUrl + "/web-push/vapid")
.then((response: VapidResponse) => { .then((response: VapidResponse) => {
this.b64 = response.data?.vapidKey || ""; this.b64 = response.data?.vapidKey || "";
console.log("Got vapid key:", this.b64); console.log("Got vapid key:", this.b64);
console.log("response...", response);
navigator.serviceWorker.addEventListener("controllerchange", () => { navigator.serviceWorker.addEventListener("controllerchange", () => {
console.log("New service worker is now controlling the page"); console.log("New service worker is now controlling the page");
}); });
@@ -360,6 +364,7 @@ export default class App extends Vue {
-1, -1,
); );
} }
}
} catch (error) { } catch (error) {
if (window.location.host.startsWith("localhost")) { if (window.location.host.startsWith("localhost")) {
console.log("Ignoring the error getting VAPID for local development."); console.log("Ignoring the error getting VAPID for local development.");