mirror of https://github.com/vector-im/riot-web
Replace QuestionDialog with InfoDialog
Display a default message if no room topic is present Signed-off-by: Bastian <matrix@noxware.de>pull/21833/head
parent
f245fa6a52
commit
8273662500
|
@ -154,13 +154,12 @@ export const CommandMap = {
|
||||||
|
|
||||||
const topicEvents = room.currentState.getStateEvents('m.room.topic', '');
|
const topicEvents = room.currentState.getStateEvents('m.room.topic', '');
|
||||||
const topic = topicEvents.getContent().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');
|
const InfoDialog = sdk.getComponent('dialogs.InfoDialog');
|
||||||
Modal.createTrackedDialog('Slash Commands', 'Topic', QuestionDialog, {
|
Modal.createTrackedDialog('Slash Commands', 'Topic', InfoDialog, {
|
||||||
title: room.name,
|
title: room.name,
|
||||||
description: <div dangerouslySetInnerHTML={{ __html: topicHtml }} />,
|
description: <div dangerouslySetInnerHTML={{ __html: topicHtml }} />,
|
||||||
hasCancelButton: false,
|
|
||||||
});
|
});
|
||||||
return success();
|
return success();
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue