diff --git a/shared/js/ui/frames/side/ConversationManager.ts b/shared/js/ui/frames/side/ConversationManager.ts index fa349e48..1c92bacf 100644 --- a/shared/js/ui/frames/side/ConversationManager.ts +++ b/shared/js/ui/frames/side/ConversationManager.ts @@ -16,6 +16,7 @@ import { import {ConversationPanel} from "../../../ui/frames/side/ConversationUI"; import {AbstractChat, AbstractChatManager, kMaxChatFrameMessageSize} from "./AbstractConversion"; import {ErrorCode} from "../../../connection/ErrorCode"; +import {LocalClientEntry} from "tc-shared/tree/Client"; const kSuccessQueryThrottle = 5 * 1000; const kErrorQueryThrottle = 30 * 1000; @@ -327,9 +328,11 @@ export class ConversationManager extends AbstractChatManager this.uiEvents.on("notify_destroy", connection.getClient().events.on("notify_client_moved", event => { - this.findOrCreateConversation(event.oldChannel.channelId).localClientSwitchedChannel("leave"); - this.findOrCreateConversation(event.newChannel.channelId).localClientSwitchedChannel("join"); + connection.events().one("notify_handler_initialized", () => this.uiEvents.on("notify_destroy", connection.channelTree.events.on("notify_client_moved", event => { + if(event.client instanceof LocalClientEntry) { + this.findOrCreateConversation(event.oldChannel.channelId).localClientSwitchedChannel("leave"); + this.findOrCreateConversation(event.newChannel.channelId).localClientSwitchedChannel("join"); + } }))); this.uiEvents.register_handler(this, true); diff --git a/shared/js/ui/frames/side/PrivateConversationManager.ts b/shared/js/ui/frames/side/PrivateConversationManager.ts index e3e46086..8d82ac41 100644 --- a/shared/js/ui/frames/side/PrivateConversationManager.ts +++ b/shared/js/ui/frames/side/PrivateConversationManager.ts @@ -18,6 +18,7 @@ import * as log from "../../../log"; import {LogCategory} from "../../../log"; import {queryConversationEvents, registerConversationEvent} from "../../../ui/frames/side/PrivateConversationHistory"; import {AbstractChat, AbstractChatManager} from "../../../ui/frames/side/AbstractConversion"; +import {ChannelTreeEvents} from "tc-shared/tree/ChannelTree"; export type OutOfViewClient = { nickname: string, @@ -181,25 +182,30 @@ export class PrivateConversation extends AbstractChat { - if(event.serverLeave) { - this.setActiveClientEntry(undefined); - this.registerChatEvent({ - type: "partner-action", - action: "disconnect", - timestamp: Date.now(), - uniqueId: "pa-" + this.chatId + "-" + Date.now() + "-" + (++receivingEventUniqueIdIndex) - }, true); - } else { - this.setActiveClientEntry({ - uniqueId: client.clientUid(), - nickname: client.clientNickName(), - clientId: client.clientId() - } as OutOfViewClient) - } - })); this.activeClientListener.push(client.events.on("notify_properties_updated", event => { if('client_nickname' in event.updated_properties) this.updateClientInfo(); diff --git a/shared/js/ui/tree/TreeEntryMove.tsx b/shared/js/ui/tree/TreeEntryMove.tsx index 1297bc0e..ac2de7fa 100644 --- a/shared/js/ui/tree/TreeEntryMove.tsx +++ b/shared/js/ui/tree/TreeEntryMove.tsx @@ -1,7 +1,7 @@ import {ReactComponentBase} from "tc-shared/ui/react-elements/ReactComponentBase"; import * as React from "react"; import * as ReactDOM from "react-dom"; -import {ChannelTreeView} from "./RendererView.tsx.old"; +import {ChannelTreeView} from "tc-shared/ui/tree/RendererView"; const moveStyle = require("./TreeEntryMove.scss");