Merge branch 'fix/conversation-delete-reappears' into main
Fixes private-board conversation deletion reappearing after refresh. - board_started now marks conversation is_local=false (server persisted) - loadConversations explicitly sets is_local=false as safety net
This commit is contained in:
commit
306c6031a5
|
|
@ -209,6 +209,9 @@ export const useChatStore = defineStore("chat", () => {
|
|||
// @board meeting (board_started persisted). Frontend uses this
|
||||
// to render the "私董会" badge in the sidebar.
|
||||
is_board: conv.is_board === true,
|
||||
// Anything returned from the server is already persisted — mark it
|
||||
// non-local so deleteConversation routes to the server endpoint.
|
||||
is_local: false,
|
||||
}));
|
||||
} catch (error) {
|
||||
console.error("Failed to load conversations:", error);
|
||||
|
|
|
|||
|
|
@ -1157,6 +1157,17 @@ export function dispatchWsEvent(
|
|||
board_round: 0,
|
||||
};
|
||||
state.appendMessage(conversationId, startMsg);
|
||||
// Board meetings are persisted server-side as soon as board_started
|
||||
// is emitted (portal intercepts and saves the message). Mark the
|
||||
// conversation non-local so deleteConversation calls the server
|
||||
// instead of only removing it from the local list — otherwise the
|
||||
// conversation reappears on the next refresh.
|
||||
const conv = state.conversations.value.find(
|
||||
(c) => c.id === conversationId,
|
||||
);
|
||||
if (conv) {
|
||||
conv.is_local = false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue