Fixed compile errors

canary
WolverinDEV 2020-09-26 23:01:53 +02:00
parent cd392ec54f
commit 8b592391ec
3 changed files with 30 additions and 21 deletions

View File

@ -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<ConversationUIEvent
this.handlePanelShow();
}));
connection.events().one("notify_handler_initialized", () => 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);

View File

@ -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<PrivateConversationUIEvent
}
}
handleEventLeftView(event: ChannelTreeEvents["notify_client_leave_view"]) {
if(event.client !== this.activeClient) {
return;
}
if(event.isServerLeave) {
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: event.client.clientUid(),
nickname: event.client.clientNickName(),
clientId: event.client.clientId()
} as OutOfViewClient)
}
}
private registerClientEvents(client: ClientEntry) {
this.activeClientListener = [];
this.activeClientListener.push(client.events.on("notify_left_view", event => {
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();

View File

@ -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");