Correctly showing the client as "left view" if we're disconnecing from the server
parent
2041ed5fc3
commit
4aef00875e
|
@ -5,7 +5,6 @@ import {ChannelEntry} from "../../tree/Channel";
|
|||
import {ServerEntry} from "../../tree/Server";
|
||||
import {openMusicManage} from "../../ui/modal/ModalMusicManage";
|
||||
import {formatMessage} from "../../ui/frames/chat";
|
||||
import {ClientInfo} from "../../ui/frames/side/client_info";
|
||||
import {MusicInfo} from "../../ui/frames/side/music_info";
|
||||
import {ConversationManager} from "../../ui/frames/side/ConversationManager";
|
||||
import {PrivateConversationManager} from "../../ui/frames/side/PrivateConversationManager";
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
import {ConnectionHandler} from "tc-shared/ConnectionHandler";
|
||||
import {ConnectionHandler, ConnectionState} from "tc-shared/ConnectionHandler";
|
||||
import {ClientEntry, ClientType, LocalClientEntry} from "tc-shared/tree/Client";
|
||||
import {
|
||||
ClientForumInfo,
|
||||
ClientGroupInfo,
|
||||
ClientInfoEvents,
|
||||
ClientStatusInfo, ClientVersionInfo
|
||||
ClientStatusInfo,
|
||||
ClientVersionInfo
|
||||
} from "tc-shared/ui/frames/side/ClientInfoDefinitions";
|
||||
|
||||
import * as ReactDOM from "react-dom";
|
||||
|
@ -93,6 +94,14 @@ export class ClientInfoController {
|
|||
this.sendOnline();
|
||||
}));
|
||||
|
||||
this.listenerConnection.push(this.connection.events().on("notify_connection_state_changed", event => {
|
||||
if(event.new_state !== ConnectionState.CONNECTED && this.currentClientStatus) {
|
||||
this.currentClient = undefined;
|
||||
this.currentClientStatus.leaveTimestamp = Date.now() / 1000;
|
||||
this.sendOnline();
|
||||
}
|
||||
}))
|
||||
|
||||
this.uiEvents.on("query_client_name", () => this.sendClientName());
|
||||
this.uiEvents.on("query_client_description", () => this.sendClientDescription());
|
||||
this.uiEvents.on("query_channel_group", () => this.sendChannelGroup());
|
||||
|
|
Loading…
Reference in New Issue