From 026a2e6c7cd600721e8faaa67c89c4122c104c20 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 17 Sep 2016 02:19:27 +0100 Subject: [PATCH] fix guest login when in a RoomView --- src/Lifecycle.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Lifecycle.js b/src/Lifecycle.js index 9f9b4b5389..53adea6196 100644 --- a/src/Lifecycle.js +++ b/src/Lifecycle.js @@ -279,7 +279,12 @@ export function logout() { // logout doesn't work for guest sessions // Also we sometimes want to re-log in a guest session // if we abort the login - onLoggedOut(); + + // use settimeout to avoid racing with react unmounting components + // which need a valid matrixclientpeg + setTimeout(()=>{ + onLoggedOut(); + }, 0); return; }