refactor variable names

This commit is contained in:
Gauthier Roebroeck 2025-05-21 10:36:36 +08:00
parent 0926bdb69f
commit 33415041de
2 changed files with 12 additions and 12 deletions

View file

@ -7,9 +7,9 @@
Error loading data
</v-alert>
<template v-if="data">
<template v-if="announcements">
<div
v-for="(item, index) in data.items"
v-for="(item, index) in announcements.items"
:key="index"
>
<v-row
@ -60,7 +60,7 @@
</v-col>
</v-row>
<v-divider
v-if="index != data.items.length - 1"
v-if="index != announcements.items.length - 1"
class="my-8"
/>
</div>
@ -82,17 +82,17 @@
import {useAnnouncements} from '@/colada/queries/announcements.ts'
import {useMarkAnnouncementsRead} from '@/colada/mutations/mark-announcements-read.ts'
const {data, error, unreadCount} = useAnnouncements()
const {data: announcements, error, unreadCount} = useAnnouncements()
const {mutate} = useMarkAnnouncementsRead()
const {mutate: markAnnouncementsRead} = useMarkAnnouncementsRead()
function markAllRead() {
const ids = data.value?.items.map(x => x.id)
if(ids) mutate(ids)
const ids = announcements.value?.items.map(x => x.id)
if(ids) markAnnouncementsRead(ids)
}
function markRead(id: string) {
mutate([id])
markAnnouncementsRead([id])
}
</script>

View file

@ -7,7 +7,7 @@
Error loading data
</v-alert>
<template v-if="data">
<template v-if="releases">
<v-row>
<v-col>
<div v-if="isLatestVersion == true">
@ -30,7 +30,7 @@
</v-row>
<div
v-for="(release, index) in data"
v-for="(release, index) in releases"
:key="index"
>
<v-row
@ -83,7 +83,7 @@
</v-row>
<v-divider
v-if="index != data.length - 1"
v-if="index != releases.length - 1"
class="my-8"
/>
</div>
@ -94,7 +94,7 @@
import {useAppReleases} from '@/colada/queries/app-releases.ts'
import {marked} from 'marked'
const {data, error, buildVersion: currentVersion, isLatestVersion, latestRelease: latest} = useAppReleases()
const {data: releases, error, buildVersion: currentVersion, isLatestVersion, latestRelease: latest} = useAppReleases()
</script>
<style lang="scss">