This commit is contained in:
team3
2026-07-12 21:21:41 +02:00
parent cde1721d10
commit a9b2f5ab9e
28 changed files with 106 additions and 706 deletions

View File

@@ -7,9 +7,9 @@ import Ueben from './components/Ueben.vue'
import Kennzahlen from './components/Kennzahlen.vue'
const topics = ref([])
const topic = ref('')
const topic = ref(localStorage.getItem('topic') || '') // Auswahl über Reload halten
const state = ref(null)
const tab = ref('board')
const tab = ref(localStorage.getItem('tab') || 'board')
const neuName = ref('')
const neuArt = ref('thema')
const fehler = ref('')
@@ -24,6 +24,9 @@ function navToggle() {
localStorage.setItem('navAuf', navAuf.value ? '1' : '0')
}
watch(navAuf, (a) => document.body.classList.toggle('nav-zu', !a), { immediate: true })
// Ansicht über Reload halten: gewähltes Topic + Tab merken
watch(topic, (t) => localStorage.setItem('topic', t))
watch(tab, (t) => localStorage.setItem('tab', t))
let wsSchliessen = null
let timer = null
@@ -40,6 +43,8 @@ media.addEventListener('change', themeAnwenden)
async function topicsLaden() {
topics.value = await api.topics()
// gemerktes Topic gelöscht? → verwerfen, dann erst auf das erste zurückfallen
if (topic.value && !topics.value.some((t) => t.name === topic.value)) topic.value = ''
if (!topic.value && topics.value.length) topic.value = topics.value[0].name
}