refactor: use module store
Signed-off-by: Sebastian <krupinski01@gmail.com>
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user