Fix null issues

This commit is contained in:
2025-09-13 20:31:39 +03:00
Unverified
parent 934b84f027
commit 002a59d3c8
3 changed files with 10 additions and 8 deletions
+4 -4
View File
@@ -1,10 +1,10 @@
import { MessagePanel, type MessagePanelCallbacks } from "./MessagePanel";
import { MessagePanel, type MessagePanelCallbacks, type MessagePanelState } from "./MessagePanel";
import {
fetchDMHistory,
decryptDm,
sendDMViaWebSocket
} from "../../api/dmApi";
import type { Message } from "../../core/types";
import type { Message, WebSocketMessage } from "../../core/types";
import type { UserState } from "../state";
export interface DMPanelData {
@@ -22,7 +22,7 @@ export class DMPanel extends MessagePanel {
constructor(
user: UserState,
callbacks: MessagePanelCallbacks,
onStateChange: (state: any) => void
onStateChange: (state: MessagePanelState) => void
) {
super("dm", user, callbacks, onStateChange);
}
@@ -116,7 +116,7 @@ export class DMPanel extends MessagePanel {
}
// Handle incoming WebSocket DM messages
handleWebSocketMessage = async (response: any): Promise<void> => {
handleWebSocketMessage = async (response: WebSocketMessage): Promise<void> => {
if (response.type === "dmNew" && this.dmData) {
const { senderId, recipientId, ...envelope } = response.data;