Исправить конфликт блокировки и исчезновение кнопки фильтра
loadMessages держит mailboxLock на активную папку — параллельный STATUS в refreshUnreadCounts падал с ошибкой, initUnreadCounts записывал 0 и кнопка пропадала по v-if. Теперь refresh() выполняет шаги последовательно. Также кнопка фильтра остаётся видимой пока фильтр активен, даже если счётчик = 0. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
6c288dcb3f
commit
068ba4144e
1 changed files with 4 additions and 5 deletions
|
|
@ -28,10 +28,9 @@ const allVisibleSelected = computed(() =>
|
||||||
// ── Refresh ───────────────────────────────────────────────
|
// ── Refresh ───────────────────────────────────────────────
|
||||||
async function refresh(): Promise<void> {
|
async function refresh(): Promise<void> {
|
||||||
if (!accountsStore.activeAccountId || !foldersStore.activeFolderId) return
|
if (!accountsStore.activeAccountId || !foldersStore.activeFolderId) return
|
||||||
await Promise.all([
|
// Последовательно: loadMessages держит mailboxLock, STATUS упадёт если папка залочена параллельно
|
||||||
messagesStore.loadMessages(accountsStore.activeAccountId, foldersStore.activeFolderId, 0),
|
await messagesStore.loadMessages(accountsStore.activeAccountId, foldersStore.activeFolderId, 0)
|
||||||
foldersStore.refreshUnreadCounts(accountsStore.activeAccountId)
|
await foldersStore.refreshUnreadCounts(accountsStore.activeAccountId)
|
||||||
])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Auto-check timer ──────────────────────────────────────
|
// ── Auto-check timer ──────────────────────────────────────
|
||||||
|
|
@ -143,7 +142,7 @@ async function handleSwipeAction(action: SwipeAction, messageId: string): Promis
|
||||||
<div class="message-list-header">
|
<div class="message-list-header">
|
||||||
<h2 class="folder-title truncate">{{ folderName }}</h2>
|
<h2 class="folder-title truncate">{{ folderName }}</h2>
|
||||||
<button
|
<button
|
||||||
v-if="activeUnread > 0"
|
v-if="activeUnread > 0 || messagesStore.unreadOnly"
|
||||||
class="message-count"
|
class="message-count"
|
||||||
:class="{ 'unread-active': messagesStore.unreadOnly }"
|
:class="{ 'unread-active': messagesStore.unreadOnly }"
|
||||||
title="Только непрочитанные"
|
title="Только непрочитанные"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue