Rooms may not have aliases
This commit is contained in:
parent
cbb72c2f29
commit
4bc4292ceb
1 changed files with 9 additions and 1 deletions
|
@ -98,9 +98,16 @@ module.exports = React.createClass({
|
||||||
var QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
|
var QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
|
||||||
var ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
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, {
|
Modal.createDialog(QuestionDialog, {
|
||||||
title: "Remove from Directory",
|
title: "Remove from Directory",
|
||||||
description: `Delete the room alias '${alias}' and remove '${name}' from the directory?`,
|
description: desc,
|
||||||
onFinished: (should_delete) => {
|
onFinished: (should_delete) => {
|
||||||
if (!should_delete) return;
|
if (!should_delete) return;
|
||||||
|
|
||||||
|
@ -109,6 +116,7 @@ module.exports = React.createClass({
|
||||||
var step = `remove '${name}' from the directory.`;
|
var step = `remove '${name}' from the directory.`;
|
||||||
|
|
||||||
MatrixClientPeg.get().setRoomDirectoryVisibility(room.room_id, 'private').then(() => {
|
MatrixClientPeg.get().setRoomDirectoryVisibility(room.room_id, 'private').then(() => {
|
||||||
|
if (!alias) return;
|
||||||
step = 'delete the alias.';
|
step = 'delete the alias.';
|
||||||
return MatrixClientPeg.get().deleteAlias(alias);
|
return MatrixClientPeg.get().deleteAlias(alias);
|
||||||
}).done(() => {
|
}).done(() => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue