mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-09-05 15:38:34 +08:00
refactor: store mail flags in sparse relation table
This commit is contained in:
@@ -142,7 +142,9 @@ const updateUnreadState = async (mails, state) => {
|
||||
}
|
||||
}
|
||||
|
||||
const markMailsRead = async (mails) => updateUnreadState(mails, getReadStateValue(false))
|
||||
const markMailsRead = async (mails) => {
|
||||
return await updateUnreadState(mails.filter(isMailUnread), getReadStateValue(false))
|
||||
}
|
||||
|
||||
const toggleCurrentMailUnread = async () => {
|
||||
if (!curMail.value) return
|
||||
|
||||
@@ -55,7 +55,7 @@ const fetchMails = async () => {
|
||||
totalCount.value = count > 0 ? count : totalCount.value;
|
||||
const rawMail = results && results.length > 0 ? results[0] : null
|
||||
currentMail.value = rawMail ? await processItem(rawMail) : null
|
||||
if (openSettings.value.enableMailStates && rawMail) {
|
||||
if (openSettings.value.enableMailStates && rawMail?.unread) {
|
||||
const state = getReadStateValue(false)
|
||||
if (!state) return
|
||||
const response = await api.fetch(`/api/mails/state`, {
|
||||
|
||||
Reference in New Issue
Block a user