From df7f1b46bf29141fd4ac60cfcf7fccff2cf9c3a7 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 12 Oct 2017 07:24:20 -0600 Subject: [PATCH] Stop peeking if anything went wrong, not just explicit failure Signed-off-by: Travis Ralston --- src/components/structures/RoomView.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index 6ecd7cbf2e..3d3537e067 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -276,6 +276,11 @@ module.exports = React.createClass({ }); this._onRoomLoaded(room); }, (err) => { + // Stop peeking if anything went wrong + this.setState({ + isPeeking: false, + }); + // This won't necessarily be a MatrixError, but we duck-type // here and say if it's got an 'errcode' key with the right value, // it means we can't peek. @@ -283,7 +288,6 @@ module.exports = React.createClass({ // This is fine: the room just isn't peekable (we assume). this.setState({ peekLoading: false, - isPeeking: false, }); } else { throw err;