Updating the channel collapsed state after channel move
parent
92191b259b
commit
3ec0f32634
|
@ -1,6 +1,7 @@
|
|||
# Changelog:
|
||||
* **04.12.20**
|
||||
- Properly logging channel creations, deletions, shows and hides
|
||||
- Fixed missing collapsed arrow update after channel move
|
||||
|
||||
* **03.12.20**
|
||||
- Fixed server connection tab move handler
|
||||
|
|
|
@ -40,7 +40,12 @@ export interface ChannelTreeEvents {
|
|||
|
||||
/* channel tree events */
|
||||
notify_channel_created: { channel: ChannelEntry },
|
||||
notify_channel_moved: { channel: ChannelEntry },
|
||||
notify_channel_moved: {
|
||||
channel: ChannelEntry,
|
||||
|
||||
previousParent: ChannelEntry | undefined,
|
||||
previousOrder: ChannelEntry | undefined,
|
||||
},
|
||||
notify_channel_deleted: { channel: ChannelEntry },
|
||||
notify_channel_client_order_changed: { channel: ChannelEntry },
|
||||
|
||||
|
@ -302,6 +307,9 @@ export class ChannelTree {
|
|||
return;
|
||||
}
|
||||
|
||||
const previousParent = channel.parent_channel();
|
||||
const previousOrder = channel.channel_previous;
|
||||
|
||||
this.unregisterChannelFromTree(channel);
|
||||
channel.channel_previous = channelPrevious;
|
||||
channel.channel_next = undefined;
|
||||
|
@ -349,7 +357,11 @@ export class ChannelTree {
|
|||
}
|
||||
|
||||
if(triggerMoveEvent) {
|
||||
this.events.fire("notify_channel_moved", { channel: channel });
|
||||
this.events.fire("notify_channel_moved", {
|
||||
channel: channel,
|
||||
previousOrder: previousOrder,
|
||||
previousParent: previousParent
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -207,9 +207,18 @@ class ChannelTreeController {
|
|||
}
|
||||
|
||||
@EventHandler<ChannelTreeEvents>("notify_channel_moved")
|
||||
private handleChannelMoved(_event: ChannelTreeEvents["notify_channel_moved"]) {
|
||||
private handleChannelMoved(event: ChannelTreeEvents["notify_channel_moved"]) {
|
||||
if(!this.channelTreeInitialized) { return; }
|
||||
this.sendChannelTreeEntries();
|
||||
|
||||
if(event.previousParent && !event.previousParent.child_channel_head) {
|
||||
/* the collapsed state arrow changed */
|
||||
this.sendChannelInfo(event.previousParent);
|
||||
}
|
||||
if(event.channel.parent_channel()) {
|
||||
/* the collapsed state arrow may changed */
|
||||
this.sendChannelInfo(event.channel.parent_channel());
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler<ChannelTreeEvents>("notify_channel_deleted")
|
||||
|
|
Loading…
Reference in New Issue