@@ -123,6 +123,9 @@ module.exports = React.createClass({
123123 // store the error here.
124124 roomLoadError : null ,
125125
126+ // Have we sent a request to join the room that we're waiting to complete?
127+ joining : false ,
128+
126129 // this is true if we are fully scrolled-down, and are looking at
127130 // the end of the live timeline. It has the effect of hiding the
128131 // 'scroll to bottom' knob, among a couple of other things.
@@ -185,10 +188,6 @@ module.exports = React.createClass({
185188 shouldPeek : RoomViewStore . shouldPeek ( ) ,
186189 } ;
187190
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-
192191 // Temporary logging to diagnose https://github.com/vector-im/riot-web/issues/4307
193192 console . log (
194193 'RVS update:' ,
@@ -197,7 +196,6 @@ module.exports = React.createClass({
197196 'loading?' , newState . roomLoading ,
198197 'joining?' , newState . joining ,
199198 'initial?' , initial ,
200- 'waiting?' , newState . waitingForRoom ,
201199 'shouldPeek?' , newState . shouldPeek ,
202200 ) ;
203201
@@ -650,7 +648,6 @@ module.exports = React.createClass({
650648 }
651649 this . setState ( {
652650 room : room ,
653- waitingForRoom : false ,
654651 } , ( ) => {
655652 this . _onRoomLoaded ( room ) ;
656653 } ) ;
@@ -706,14 +703,7 @@ module.exports = React.createClass({
706703
707704 onRoomMemberMembership : function ( ev , member , oldMembership ) {
708705 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 ( ) ;
717707 }
718708 } ,
719709
@@ -1463,10 +1453,6 @@ module.exports = React.createClass({
14631453 const Loader = sdk . getComponent ( "elements.Spinner" ) ;
14641454 const TimelinePanel = sdk . getComponent ( "structures.TimelinePanel" ) ;
14651455
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-
14701456 if ( ! this . state . room ) {
14711457 if ( this . state . roomLoading || this . state . peekLoading ) {
14721458 return (
@@ -1500,7 +1486,7 @@ module.exports = React.createClass({
15001486 onRejectClick = { this . onRejectThreepidInviteButtonClicked }
15011487 canPreview = { false } error = { this . state . roomLoadError }
15021488 roomAlias = { roomAlias }
1503- spinner = { previewBarSpinner }
1489+ spinner = { this . state . joining }
15041490 inviterName = { inviterName }
15051491 invitedEmail = { invitedEmail }
15061492 room = { this . state . room }
@@ -1543,7 +1529,7 @@ module.exports = React.createClass({
15431529 onRejectClick = { this . onRejectButtonClicked }
15441530 inviterName = { inviterName }
15451531 canPreview = { false }
1546- spinner = { previewBarSpinner }
1532+ spinner = { this . state . joining }
15471533 room = { this . state . room }
15481534 />
15491535 </ div >
@@ -1618,7 +1604,7 @@ module.exports = React.createClass({
16181604 < RoomPreviewBar onJoinClick = { this . onJoinButtonClicked }
16191605 onForgetClick = { this . onForgetClick }
16201606 onRejectClick = { this . onRejectThreepidInviteButtonClicked }
1621- spinner = { previewBarSpinner }
1607+ spinner = { this . state . joining }
16221608 inviterName = { inviterName }
16231609 invitedEmail = { invitedEmail }
16241610 canPreview = { this . state . canPeek }
0 commit comments