diff --git a/shared/js/tree/Channel.ts b/shared/js/tree/Channel.ts index ec1c8029..f64757cf 100644 --- a/shared/js/tree/Channel.ts +++ b/shared/js/tree/Channel.ts @@ -346,10 +346,15 @@ export class ChannelEntry extends ChannelTreeEntry { } } + if(!this.properties.channel_description) { + return { status: "empty" }; + } + return { status: "success", - description: this.properties.channel_description - } + description: this.properties.channel_description, + handlerId: this.channelTree.client.handlerId + }; } isDescriptionCached() { diff --git a/shared/js/tree/ChannelDefinitions.ts b/shared/js/tree/ChannelDefinitions.ts index 841295f9..7aa32fc0 100644 --- a/shared/js/tree/ChannelDefinitions.ts +++ b/shared/js/tree/ChannelDefinitions.ts @@ -1,6 +1,8 @@ export type ChannelDescriptionResult = { status: "success", description: string, + + /* The handler id is required for BBCode renderers */ handlerId: string } | { status: "empty" diff --git a/shared/js/ui/modal/channel-info/Controller.ts b/shared/js/ui/modal/channel-info/Controller.ts index 358b1d62..5f745695 100644 --- a/shared/js/ui/modal/channel-info/Controller.ts +++ b/shared/js/ui/modal/channel-info/Controller.ts @@ -112,14 +112,7 @@ class Controller { })); this.variables.setVariableProvider("password", () => this.channel.properties.channel_flag_password); this.variables.setVariableProvider("topic", () => this.channel.properties.channel_topic); - this.variables.setVariableProvider("description", async () => { - const result = _.cloneDeep(await this.channel.getChannelDescription(false)); - if(result.status === "success") { - result.handlerId = this.channel.channelTree.client.handlerId; - return result; - } - return result; - }); + this.variables.setVariableProvider("description", async () => await this.channel.getChannelDescription(false)); this.events.on("action_reload_description", () => { this.channel.clearDescriptionCache();