Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Close modal after re-attempt of room creation, not before
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Ferrazzutti <fair@miscworks.net>
  • Loading branch information
AndrewFerr committed Oct 3, 2021
1 parent d9e9dca commit 0183e0b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/createRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');

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).
Expand All @@ -233,6 +231,8 @@ export default async function createRoom(opts: IOpts): Promise<string | null> {
} else {
return Promise.reject(err);
}
}).finally(function() {
if (modal) modal.close();
}).then(function(res) {
roomId = res.room_id;
if (opts.dmUserId) {
Expand Down

0 comments on commit 0183e0b

Please sign in to comment.