mirror of
https://github.com/fromchat-messenger/web.git
synced 2026-09-22 19:15:08 +03:00
Fix messages appearing in the wrong chat
This commit is contained in:
@@ -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) {
|
||||
@@ -208,6 +209,7 @@ export function handleWebSocketMessage(response: WebSocketMessage): void {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const publicChatPanel = new PublicChatPanel();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user