fix: show live ticker across app and website and suppress review emails
Some checks failed
Code Analysis and Production Deploy / analyze (push) Failing after 5m18s
Code Analysis and Production Deploy / deploy-production (push) Has been skipped
Code Analysis and Production Deploy / deploy-test (push) Has been skipped

This commit is contained in:
Torsten Schulz (local)
2026-10-29 21:49:51 +01:00
parent 10a37180de
commit 472bec4519
29 changed files with 280 additions and 70 deletions

View File

@@ -1,7 +1,7 @@
<template>
<section
v-if="isInternal && matches.length"
class="fixed top-20 z-40 w-full border-y border-primary-200 bg-primary-50 text-primary-950 shadow-sm"
v-if="authStore.isLoggedIn && matches.length"
class="relative z-40 w-full shrink-0 border-y border-primary-200 bg-primary-50 text-primary-950 shadow-sm"
>
<div class="mx-auto flex max-w-7xl items-center gap-3 px-4 py-2 text-sm sm:px-6">
<button
@@ -60,18 +60,15 @@
</template>
<script setup>
import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
import { useRoute } from 'vue-router'
import { onMounted, onUnmounted, ref, watch } from 'vue'
import { useAuthStore } from '~/stores/auth'
const route = useRoute()
const authStore = useAuthStore()
const matches = ref([])
const soundEnabled = ref(false)
const paused = ref(false)
const tickerTrack = ref(null)
const tickerDuration = ref(30)
const isInternal = computed(() => authStore.isLoggedIn && (route.path.startsWith('/mitgliederbereich') || route.path.startsWith('/cms')))
let timer
let audioContext
let tickerLoaded = false
@@ -127,7 +124,7 @@ function toggleSound() {
}
async function load() {
if (!isInternal.value) {
if (!authStore.isLoggedIn) {
matches.value = []
tickerLoaded = false
previousStates = new Map()
@@ -135,6 +132,7 @@ async function load() {
}
try {
const nextMatches = (await $fetch('/api/mitgliederbereich/live-ticker')).matches || []
if (!authStore.isLoggedIn) return
const nextStates = stateByMeeting(nextMatches)
if (tickerLoaded && soundEnabled.value && hasRelevantChange(nextStates)) playPing()
previousStates = nextStates
@@ -148,7 +146,7 @@ onMounted(() => {
timer = setInterval(load, 30_000)
})
onUnmounted(() => clearInterval(timer))
watch(isInternal, load)
watch(() => authStore.isLoggedIn, load)
</script>
<style scoped>