Fix messages appearing in the wrong chat

This commit is contained in:
2025-08-26 19:34:26 +03:00
Unverified
parent ebeeaa29a6
commit 4a21923c69
+3 -1
View File
@@ -13,7 +13,7 @@ import { show as showContextMenu } from "./contextMenu";
import { show as showUserProfileDialog } from "./profileDialog";
import defaultAvatar from "../resources/images/default-avatar.png";
import { authToken, currentUser, getAuthHeaders } from "../auth/api";
import { PublicChatPanel } from "./panel";
import { ChatPanelController, PublicChatPanel } from "./panel";
/**
* Adds a new message to the chat interface
@@ -189,6 +189,7 @@ export function removeMessage(messageId: number): void {
* @param {WebSocketMessage} response - WebSocket response
*/
export function handleWebSocketMessage(response: WebSocketMessage): void {
if (ChatPanelController.active == publicChatPanel) {
switch (response.type) {
case 'messageEdited':
if (response.data) {
@@ -207,6 +208,7 @@ export function handleWebSocketMessage(response: WebSocketMessage): void {
}
break;
}
}
}
export const publicChatPanel = new PublicChatPanel();