Fix the chat switching animation

This commit is contained in:
2025-10-05 19:09:03 +03:00
Unverified
parent 014da1702b
commit 438284ca95
17 changed files with 249 additions and 369 deletions
+8 -4
View File
@@ -33,15 +33,19 @@ export class DMPanel extends MessagePanel {
}
async activate(): Promise<void> {
if (this.dmData && !this.messagesLoaded) {
await this.loadMessages();
}
// Don't load messages immediately during activation to prevent animation freeze
// Messages will be loaded after the animation completes
}
deactivate(): void {
// DM doesn't need special cleanup
}
clearMessages(): void {
super.clearMessages();
this.messagesLoaded = false;
}
private async parseTextPayload(env: DmEnvelope, decryptedMessages: Message[]) {
const plaintext = await decryptDm(env, this.dmData!.publicKey);
const isAuthor = env.senderId !== this.dmData!.userId;
@@ -164,7 +168,7 @@ export class DMPanel extends MessagePanel {
}
// Handle incoming WebSocket DM messages
handleWebSocketMessage = async (response: DMWebSocketMessage): Promise<void> => {
async handleWebSocketMessage(response: DMWebSocketMessage): Promise<void> {
if (response.type === "dmNew" && this.dmData) {
const envelope = response.data;