forked from jsnbuchanan/crowd-funder-for-time-pwa
allow a test notification from the notification help screen
This commit is contained in:
14
src/App.vue
14
src/App.vue
@@ -281,7 +281,7 @@ interface VapidResponse {
|
||||
};
|
||||
}
|
||||
|
||||
import { AppString } from "@/constants/app";
|
||||
import { DEFAULT_PUSH_SERVER } from "@/constants/app";
|
||||
import { db } from "@/db/index";
|
||||
import { MASTER_SETTINGS_KEY } from "@/db/tables/settings";
|
||||
|
||||
@@ -302,7 +302,7 @@ export default class App extends Vue {
|
||||
try {
|
||||
await db.open();
|
||||
const settings = await db.settings.get(MASTER_SETTINGS_KEY);
|
||||
let pushUrl: string = AppString.DEFAULT_PUSH_SERVER;
|
||||
let pushUrl = DEFAULT_PUSH_SERVER;
|
||||
if (settings?.webPushServer) {
|
||||
pushUrl = settings.webPushServer;
|
||||
}
|
||||
@@ -446,7 +446,9 @@ export default class App extends Vue {
|
||||
}
|
||||
})
|
||||
.then(() => {
|
||||
console.log("Subscription data sent to server.");
|
||||
console.log(
|
||||
"Subscription data sent to server and all finished successfully.",
|
||||
);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(
|
||||
@@ -510,11 +512,7 @@ export default class App extends Vue {
|
||||
resolve();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error(
|
||||
"Subscription or server communication failed:",
|
||||
error,
|
||||
options,
|
||||
);
|
||||
console.error("Push subscription failed:", error, options);
|
||||
|
||||
// Inform the user about the issue
|
||||
alert(
|
||||
|
||||
Reference in New Issue
Block a user