Rooms may not have aliases

pull/1688/head
David Baker 2016-06-23 11:12:25 +01:00
parent cbb72c2f29
commit 4bc4292ceb
1 changed files with 9 additions and 1 deletions

View File

@ -98,9 +98,16 @@ module.exports = React.createClass({
var QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
var desc;
if (alias) {
desc = `Delete the room alias '${alias}' and remove '${name}' from the directory?`;
} else {
desc = `Remove '${name}' from the directory?`;
}
Modal.createDialog(QuestionDialog, {
title: "Remove from Directory",
description: `Delete the room alias '${alias}' and remove '${name}' from the directory?`,
description: desc,
onFinished: (should_delete) => {
if (!should_delete) return;
@ -109,6 +116,7 @@ module.exports = React.createClass({
var step = `remove '${name}' from the directory.`;
MatrixClientPeg.get().setRoomDirectoryVisibility(room.room_id, 'private').then(() => {
if (!alias) return;
step = 'delete the alias.';
return MatrixClientPeg.get().deleteAlias(alias);
}).done(() => {