@@ -123,6 +123,9 @@ module.exports = React.createClass({
123
123
// store the error here.
124
124
roomLoadError : null ,
125
125
126
+ // Have we sent a request to join the room that we're waiting to complete?
127
+ joining : false ,
128
+
126
129
// this is true if we are fully scrolled-down, and are looking at
127
130
// the end of the live timeline. It has the effect of hiding the
128
131
// 'scroll to bottom' knob, among a couple of other things.
@@ -185,10 +188,6 @@ module.exports = React.createClass({
185
188
shouldPeek : RoomViewStore . shouldPeek ( ) ,
186
189
} ;
187
190
188
- // finished joining, start waiting for a room and show a spinner. See onRoom.
189
- newState . waitingForRoom = this . state . joining && ! newState . joining &&
190
- ! RoomViewStore . getJoinError ( ) ;
191
-
192
191
// Temporary logging to diagnose https://github.com/vector-im/riot-web/issues/4307
193
192
console . log (
194
193
'RVS update:' ,
@@ -197,7 +196,6 @@ module.exports = React.createClass({
197
196
'loading?' , newState . roomLoading ,
198
197
'joining?' , newState . joining ,
199
198
'initial?' , initial ,
200
- 'waiting?' , newState . waitingForRoom ,
201
199
'shouldPeek?' , newState . shouldPeek ,
202
200
) ;
203
201
@@ -650,7 +648,6 @@ module.exports = React.createClass({
650
648
}
651
649
this . setState ( {
652
650
room : room ,
653
- waitingForRoom : false ,
654
651
} , ( ) => {
655
652
this . _onRoomLoaded ( room ) ;
656
653
} ) ;
@@ -706,14 +703,7 @@ module.exports = React.createClass({
706
703
707
704
onRoomMemberMembership : function ( ev , member , oldMembership ) {
708
705
if ( member . userId == MatrixClientPeg . get ( ) . credentials . userId ) {
709
-
710
- if ( member . membership === 'join' ) {
711
- this . setState ( {
712
- waitingForRoom : false ,
713
- } ) ;
714
- } else {
715
- this . forceUpdate ( ) ;
716
- }
706
+ this . forceUpdate ( ) ;
717
707
}
718
708
} ,
719
709
@@ -1463,10 +1453,6 @@ module.exports = React.createClass({
1463
1453
const Loader = sdk . getComponent ( "elements.Spinner" ) ;
1464
1454
const TimelinePanel = sdk . getComponent ( "structures.TimelinePanel" ) ;
1465
1455
1466
- // Whether the preview bar spinner should be shown. We do this when joining or
1467
- // when waiting for a room to be returned by js-sdk when joining
1468
- const previewBarSpinner = this . state . joining || this . state . waitingForRoom ;
1469
-
1470
1456
if ( ! this . state . room ) {
1471
1457
if ( this . state . roomLoading || this . state . peekLoading ) {
1472
1458
return (
@@ -1500,7 +1486,7 @@ module.exports = React.createClass({
1500
1486
onRejectClick = { this . onRejectThreepidInviteButtonClicked }
1501
1487
canPreview = { false } error = { this . state . roomLoadError }
1502
1488
roomAlias = { roomAlias }
1503
- spinner = { previewBarSpinner }
1489
+ spinner = { this . state . joining }
1504
1490
inviterName = { inviterName }
1505
1491
invitedEmail = { invitedEmail }
1506
1492
room = { this . state . room }
@@ -1543,7 +1529,7 @@ module.exports = React.createClass({
1543
1529
onRejectClick = { this . onRejectButtonClicked }
1544
1530
inviterName = { inviterName }
1545
1531
canPreview = { false }
1546
- spinner = { previewBarSpinner }
1532
+ spinner = { this . state . joining }
1547
1533
room = { this . state . room }
1548
1534
/>
1549
1535
</ div >
@@ -1618,7 +1604,7 @@ module.exports = React.createClass({
1618
1604
< RoomPreviewBar onJoinClick = { this . onJoinButtonClicked }
1619
1605
onForgetClick = { this . onForgetClick }
1620
1606
onRejectClick = { this . onRejectThreepidInviteButtonClicked }
1621
- spinner = { previewBarSpinner }
1607
+ spinner = { this . state . joining }
1622
1608
inviterName = { inviterName }
1623
1609
invitedEmail = { invitedEmail }
1624
1610
canPreview = { this . state . canPeek }
0 commit comments