From c51e6907f0f28a63648e5550ab651bc63ae7454d Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 17 Sep 2016 02:19:32 +0100 Subject: [PATCH] fix spinner on createroom --- src/createRoom.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/createRoom.js b/src/createRoom.js index 9104f0ff6d..a1512e23f6 100644 --- a/src/createRoom.js +++ b/src/createRoom.js @@ -41,10 +41,12 @@ function createRoom(opts) { const client = MatrixClientPeg.get(); if (client.isGuest()) { - Modal.createDialog(NeedToRegisterDialog, { - title: "Please Register", - description: "Guest users can't create new rooms. Please register to create room and start a chat." - }); + setTimeout(()=>{ + Modal.createDialog(NeedToRegisterDialog, { + title: "Please Register", + description: "Guest users can't create new rooms. Please register to create room and start a chat." + }) + }, 0); return q(null); } @@ -74,11 +76,14 @@ function createRoom(opts) { } ]; - const modal = Modal.createDialog(Loader, null, 'mx_Dialog_spinner'); + let modal; + setTimeout(()=>{ + modal = Modal.createDialog(Loader, null, 'mx_Dialog_spinner') + }, 0); let roomId; return client.createRoom(createOpts).finally(function() { - modal.close(); + if (modal) modal.close(); }).then(function(res) { roomId = res.room_id; if (opts.dmUserId) {