Migrate frontend realtime messaging to SSE.
Switch service integrations and screen/store consumers from websocket events to SSE, and ignore generated dist-web artifacts. Made-with: Cursor
This commit is contained in:
@@ -459,9 +459,21 @@ export const deleteMessage = async (messageId: string): Promise<void> => {
|
||||
};
|
||||
|
||||
// 更新消息状态(如撤回)
|
||||
export const updateMessageStatus = async (messageId: string, status: string): Promise<void> => {
|
||||
// clearContent=true 时,会同时清空本地存储的消息内容与 segments,仅保留状态占位
|
||||
export const updateMessageStatus = async (
|
||||
messageId: string,
|
||||
status: string,
|
||||
clearContent: boolean = false
|
||||
): Promise<void> => {
|
||||
await enqueueWrite(async () => {
|
||||
const database = await getDb();
|
||||
if (clearContent) {
|
||||
await database.runAsync(
|
||||
`UPDATE messages SET status = ?, content = '', segments = '[]' WHERE id = ?`,
|
||||
[status, messageId]
|
||||
);
|
||||
return;
|
||||
}
|
||||
await database.runAsync(
|
||||
`UPDATE messages SET status = ? WHERE id = ?`,
|
||||
[status, messageId]
|
||||
|
||||
Reference in New Issue
Block a user