From db7d863ce4f5f5fce4b09b4289358a6b48e8e648 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Tue, 19 Jan 2016 15:18:16 +0000 Subject: [PATCH] set autoPeekDone on finally --- src/components/structures/RoomView.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index a8c2cca56d..4dc6c33eef 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -119,10 +119,6 @@ module.exports = React.createClass({ if (this.props.autoPeek) { console.log("Attempting to peek into room %s", this.props.roomId); MatrixClientPeg.get().peekInRoom(this.props.roomId).done(() => { - this.setState({ - autoPeekDone: true - }); - // we don't need to do anything - JS SDK will emit Room events // which will update the UI. We *do* however need to know if we // can join the room so we can fiddle with the UI appropriately. @@ -130,6 +126,10 @@ module.exports = React.createClass({ // ...XXX: or do we? can't we just do them onNewRoom? }, function(err) { console.error("Failed to peek into room: %s", err); + }).finally((() => { + this.setState({ + autoPeekDone: true + }); }); } }