From 8273662500888a5a58778ac46939d1e3988777e2 Mon Sep 17 00:00:00 2001 From: Bastian Date: Thu, 31 Jan 2019 18:00:37 +0100 Subject: [PATCH] Replace QuestionDialog with InfoDialog Display a default message if no room topic is present Signed-off-by: Bastian --- src/SlashCommands.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/SlashCommands.js b/src/SlashCommands.js index d70d970796..f31bf32eac 100644 --- a/src/SlashCommands.js +++ b/src/SlashCommands.js @@ -154,13 +154,12 @@ export const CommandMap = { const topicEvents = room.currentState.getStateEvents('m.room.topic', ''); const topic = topicEvents.getContent().topic; - const topicHtml = linkifyString(sanitizeHtml(topic)); + const topicHtml = topic ? linkifyString(sanitizeHtml(topic)) : _t('This room has no topic.'); - const QuestionDialog = sdk.getComponent('dialogs.QuestionDialog'); - Modal.createTrackedDialog('Slash Commands', 'Topic', QuestionDialog, { + const InfoDialog = sdk.getComponent('dialogs.InfoDialog'); + Modal.createTrackedDialog('Slash Commands', 'Topic', InfoDialog, { title: room.name, description:
, - hasCancelButton: false, }); return success(); },