update
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user