refactor: use module store

Signed-off-by: Sebastian <krupinski01@gmail.com>
This commit is contained in:
2026-03-03 21:57:17 -05:00
parent 00cbd15cf7
commit 4fd3042271
4 changed files with 284 additions and 184 deletions

View File

@@ -116,6 +116,11 @@ const readCount = computed(() => {
const totalCount = computed(() => {
return props.selectedCollection?.properties.total ?? 0
})
// True only when the collection explicitly provides total/unread counts
const hasCountData = computed(() => {
return props.selectedCollection?.properties.total != null
})
</script>
<template>
@@ -124,13 +129,13 @@ const totalCount = computed(() => {
<div v-if="selectedCollection" class="message-list-header">
<h2 class="text-h6">{{ selectedCollection.properties.label || 'Folder' }}</h2>
<div class="folder-counts text-caption text-medium-emphasis">
<span v-if="totalCount > 0">
<span v-if="hasCountData">
<span class="unread-count">{{ unreadCount }}</span>
<span class="mx-1">/</span>
<span>{{ totalCount }}</span>
</span>
<span v-else>
Empty
<span v-else-if="messages.length > 0">
{{ messages.length }} loaded
</span>
</div>
</div>