Close modal after re-attempt of room creation, not before

Signed-off-by: Andrew Ferrazzutti <fair@miscworks.net>
pull/21833/head
Andrew Ferrazzutti 2021-10-03 02:33:25 -04:00
parent 017b2e0444
commit 073c5307f8
1 changed files with 3 additions and 3 deletions

View File

@ -219,9 +219,7 @@ export default async function createRoom(opts: IOpts): Promise<string | null> {
if (opts.spinner) modal = Modal.createDialog(Spinner, null, 'mx_Dialog_spinner'); if (opts.spinner) modal = Modal.createDialog(Spinner, null, 'mx_Dialog_spinner');
let roomId; let roomId;
return client.createRoom(createOpts).finally(function() { return client.createRoom(createOpts).catch(function(err) {
if (modal) modal.close();
}).catch(function(err) {
// NB This checks for the Synapse-specific error condition of a room creation // 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, // having been denied because the requesting user wanted to publish the room,
// but the server denies them that permission (via room_list_publication_rules). // but the server denies them that permission (via room_list_publication_rules).
@ -233,6 +231,8 @@ export default async function createRoom(opts: IOpts): Promise<string | null> {
} else { } else {
return Promise.reject(err); return Promise.reject(err);
} }
}).finally(function() {
if (modal) modal.close();
}).then(function(res) { }).then(function(res) {
roomId = res.room_id; roomId = res.room_id;
if (opts.dmUserId) { if (opts.dmUserId) {