allow a test notification from the notification help screen

This commit is contained in:
2023-12-24 21:24:51 -07:00
parent 853eb3c623
commit 05c6ddda02
10 changed files with 183 additions and 45 deletions

View File

@@ -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(