feat: update push notification subscription flow and remove deprecated opt-in component
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 2m43s

This commit is contained in:
2026-04-19 22:16:38 -04:00
parent d7b1962903
commit fd28c89cbf
6 changed files with 15 additions and 246 deletions

View File

@@ -2,8 +2,6 @@
import { useRouter, useRoute } from 'vue-router'
import { computed, ref, onMounted, onUnmounted } from 'vue'
import LoginButton from '../components/shared/LoginButton.vue'
import PushOptIn from '../components/notification/PushOptIn.vue'
import { subscribeToPush } from '@/services/pushSubscription'
import { eventBus } from '@/common/eventBus'
import type {
Event,
@@ -70,17 +68,10 @@ function handleChoreConfirmationBadge(event: Event) {
// Version fetching
const appVersion = ref('')
function onVisibilityChange() {
if (document.visibilityState === 'visible') {
subscribeToPush()
}
}
onMounted(async () => {
await fetchNotificationCount()
eventBus.on('child_reward_request', handleRewardRequestBadge)
eventBus.on('child_chore_confirmation', handleChoreConfirmationBadge)
document.addEventListener('visibilitychange', onVisibilityChange)
try {
const resp = await fetch('/api/version')
@@ -96,7 +87,6 @@ onMounted(async () => {
onUnmounted(() => {
eventBus.off('child_reward_request', handleRewardRequestBadge)
eventBus.off('child_chore_confirmation', handleChoreConfirmationBadge)
document.removeEventListener('visibilitychange', onVisibilityChange)
})
</script>
@@ -176,7 +166,6 @@ onUnmounted(() => {
</header>
<main class="main-content">
<PushOptIn />
<router-view :key="$route.fullPath" />
</main>