@@ -93,6 +93,7 @@ module.exports = React.createClass({
93
93
roomId : null ,
94
94
roomLoading : true ,
95
95
peekLoading : false ,
96
+ shouldPeek : true ,
96
97
97
98
// The event to be scrolled to initially
98
99
initialEventId : null ,
@@ -169,21 +170,25 @@ module.exports = React.createClass({
169
170
initialEventPixelOffset : RoomViewStore . getInitialEventPixelOffset ( ) ,
170
171
isInitialEventHighlighted : RoomViewStore . isInitialEventHighlighted ( ) ,
171
172
forwardingEvent : RoomViewStore . getForwardingEvent ( ) ,
173
+ shouldPeek : RoomViewStore . shouldPeek ( ) ,
172
174
} ;
173
175
176
+ // finished joining, start waiting for a room and show a spinner. See onRoom.
177
+ newState . waitingForRoom = this . state . joining && ! newState . joining &&
178
+ ! RoomViewStore . getJoinError ( ) ;
179
+
174
180
// Temporary logging to diagnose https://github.com/vector-im/riot-web/issues/4307
175
181
console . log (
176
182
'RVS update:' ,
177
183
newState . roomId ,
178
184
newState . roomAlias ,
179
185
'loading?' , newState . roomLoading ,
180
186
'joining?' , newState . joining ,
187
+ 'initial?' , initial ,
188
+ 'waiting?' , newState . waitingForRoom ,
189
+ 'shouldPeek?' , newState . shouldPeek ,
181
190
) ;
182
191
183
- // finished joining, start waiting for a room and show a spinner. See onRoom.
184
- newState . waitingForRoom = this . state . joining && ! newState . joining &&
185
- ! RoomViewStore . getJoinError ( ) ;
186
-
187
192
// NB: This does assume that the roomID will not change for the lifetime of
188
193
// the RoomView instance
189
194
if ( initial ) {
@@ -239,7 +244,7 @@ module.exports = React.createClass({
239
244
if ( ! this . state . joining && this . state . roomId ) {
240
245
if ( this . props . autoJoin ) {
241
246
this . onJoinButtonClicked ( ) ;
242
- } else if ( ! room ) {
247
+ } else if ( ! room && this . state . shouldPeek ) {
243
248
console . log ( "Attempting to peek into room %s" , this . state . roomId ) ;
244
249
this . setState ( {
245
250
peekLoading : true ,
0 commit comments