Fixed channel unsubscribe/subscribe issue (#47)

This commit is contained in:
WolverinDEV 2019-06-09 10:40:44 +02:00
parent 9450f4fc81
commit 1cf166eefb

View file

@ -471,28 +471,35 @@ class ChannelEntry {
name: tr("<b>Switch to channel</b>"), name: tr("<b>Switch to channel</b>"),
callback: () => this.joinChannel() callback: () => this.joinChannel()
}, },
MenuEntry.HR(), ...(() => {
{ const local_client = this.channelTree.client.getClient();
type: MenuEntryType.ENTRY, if (!local_client || local_client.currentChannel() !== this)
icon: "client-subscribe_to_channel", return [
name: tr("<b>Subscribe to channel</b>"), MenuEntry.HR(),
callback: () => this.subscribe(), {
visible: !this.flag_subscribed type: MenuEntryType.ENTRY,
}, icon: "client-subscribe_to_channel",
{ name: tr("<b>Subscribe to channel</b>"),
type: MenuEntryType.ENTRY, callback: () => this.subscribe(),
icon: "client-channel_unsubscribed", visible: !this.flag_subscribed
name: tr("<b>Unsubscribe from channel</b>"), },
callback: () => this.unsubscribe(), {
visible: this.flag_subscribed type: MenuEntryType.ENTRY,
}, icon: "client-channel_unsubscribed",
{ name: tr("<b>Unsubscribe from channel</b>"),
type: MenuEntryType.ENTRY, callback: () => this.unsubscribe(),
icon: "client-subscribe_mode", visible: this.flag_subscribed
name: tr("<b>Use inherited subscribe mode</b>"), },
callback: () => this.unsubscribe(true), {
visible: this.subscribe_mode != ChannelSubscribeMode.INHERITED type: MenuEntryType.ENTRY,
}, icon: "client-subscribe_mode",
name: tr("<b>Use inherited subscribe mode</b>"),
callback: () => this.unsubscribe(true),
visible: this.subscribe_mode != ChannelSubscribeMode.INHERITED
}
];
return [];
})(),
MenuEntry.HR(), MenuEntry.HR(),
{ {
type: MenuEntryType.ENTRY, type: MenuEntryType.ENTRY,