fix: favourite_chats

This commit is contained in:
CrescentLeaf
2026-01-01 18:52:12 +08:00
parent 72ca6a2fca
commit 4e57a5f9e9
2 changed files with 3 additions and 4 deletions

View File

@@ -150,7 +150,7 @@ export default class User {
}
getFavouriteChats() {
try {
return JSON.parse(this.bean.favourite_chats) as string[]
return [...(JSON.parse(this.bean.favourite_chats) as string[]), ChatPrivate.findOrCreateForPrivate(this, this).bean.id]
} catch (e) {
console.log(chalk.yellow(`警告: 收藏对话解析失败: ${(e as Error).message}`))
return []