From 073c5307f83459c32a0607d127795fc98bb182f8 Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Sun, 3 Oct 2021 02:33:25 -0400 Subject: [PATCH] Close modal after re-attempt of room creation, not before Signed-off-by: Andrew Ferrazzutti --- src/createRoom.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/createRoom.ts b/src/createRoom.ts index 7f915bd051..daf8594e23 100644 --- a/src/createRoom.ts +++ b/src/createRoom.ts @@ -219,9 +219,7 @@ export default async function createRoom(opts: IOpts): Promise { if (opts.spinner) modal = Modal.createDialog(Spinner, null, 'mx_Dialog_spinner'); let roomId; - return client.createRoom(createOpts).finally(function() { - if (modal) modal.close(); - }).catch(function(err) { + return client.createRoom(createOpts).catch(function(err) { // NB This checks for the Synapse-specific error condition of a room creation // having been denied because the requesting user wanted to publish the room, // but the server denies them that permission (via room_list_publication_rules). @@ -233,6 +231,8 @@ export default async function createRoom(opts: IOpts): Promise { } else { return Promise.reject(err); } + }).finally(function() { + if (modal) modal.close(); }).then(function(res) { roomId = res.room_id; if (opts.dmUserId) {