move push notification setup out of an App.vue Notification and into a component

This commit is contained in:
2024-11-18 17:00:06 -07:00
parent 228f213c10
commit 73df9f374a
5 changed files with 491 additions and 506 deletions

View File

@@ -210,6 +210,7 @@
Troubleshoot your notification setup.
</router-link>
</div>
<PushNotificationPermission ref="pushNotificationPermission" />
<div
id="sectionSearchLocation"
@@ -722,6 +723,7 @@ import { useClipboard } from "@vueuse/core";
import EntityIcon from "@/components/EntityIcon.vue";
import ImageMethodDialog from "@/components/ImageMethodDialog.vue";
import PushNotificationPermission from "@/components/PushNotificationPermission.vue";
import QuickNav from "@/components/QuickNav.vue";
import TopMessage from "@/components/TopMessage.vue";
import UserNameDialog from "@/components/UserNameDialog.vue";
@@ -763,6 +765,7 @@ const inputImportFileNameRef = ref<Blob>();
components: {
EntityIcon,
ImageMethodDialog,
PushNotificationPermission,
QuickNav,
TopMessage,
UserNameDialog,
@@ -954,15 +957,9 @@ export default class AccountViewView extends Vue {
async showNotificationChoice() {
if (!this.subscription) {
this.$notify(
{
group: "modal",
type: "notification-permission",
title: "", // unused, only here to satisfy type check
text: "", // unused, only here to satisfy type check
},
-1,
);
(
this.$refs.pushNotificationPermission as PushNotificationPermission
).open();
} else {
this.$notify(
{