支持一键已读

This commit is contained in:
cc
2026-05-04 23:34:49 +08:00
parent fd0db6e306
commit c09128b83e
8 changed files with 110 additions and 0 deletions

View File

@@ -978,6 +978,23 @@ class ChatService {
}
}
async markAllSessionsRead(): Promise<{ success: boolean; error?: string }> {
try {
const connectResult = await this.ensureConnected()
if (!connectResult.success) {
return { success: false, error: connectResult.error }
}
const result = await wcdbService.markAllSessionsRead()
if (result.success) {
this.syntheticUnreadState.clear()
}
return result
} catch (e) {
console.error('ChatService: 一键已读失败:', e)
return { success: false, error: String(e) }
}
}
private getSessionUsername(row: Record<string, any>): string {
return String(
row.username ||