mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-18 12:42:06 +03:00
Merge pull request #2143 from matrix-org/bwindels/fixreconnectspinner
Fix: show spinner again while recovering from connection error
This commit is contained in:
commit
bc97a3efb5
4 changed files with 6 additions and 5 deletions
|
@ -76,7 +76,7 @@ const TagPanel = React.createClass({
|
||||||
|
|
||||||
_onClientSync(syncState, prevState) {
|
_onClientSync(syncState, prevState) {
|
||||||
// Consider the client reconnected if there is no error with syncing.
|
// Consider the client reconnected if there is no error with syncing.
|
||||||
// This means the state could be RECONNECTING, SYNCING or PREPARED.
|
// This means the state could be RECONNECTING, SYNCING, PREPARED or CATCHUP.
|
||||||
const reconnected = syncState !== "ERROR" && prevState !== syncState;
|
const reconnected = syncState !== "ERROR" && prevState !== syncState;
|
||||||
if (reconnected) {
|
if (reconnected) {
|
||||||
// Load joined groups
|
// Load joined groups
|
||||||
|
|
|
@ -1146,10 +1146,11 @@ var TimelinePanel = React.createClass({
|
||||||
// of paginating our way through the entire history of the room.
|
// of paginating our way through the entire history of the room.
|
||||||
const stickyBottom = !this._timelineWindow.canPaginate(EventTimeline.FORWARDS);
|
const stickyBottom = !this._timelineWindow.canPaginate(EventTimeline.FORWARDS);
|
||||||
|
|
||||||
// If the state is PREPARED, we're still waiting for the js-sdk to sync with
|
// If the state is PREPARED or CATCHUP, we're still waiting for the js-sdk to sync with
|
||||||
// the HS and fetch the latest events, so we are effectively forward paginating.
|
// the HS and fetch the latest events, so we are effectively forward paginating.
|
||||||
const forwardPaginating = (
|
const forwardPaginating = (
|
||||||
this.state.forwardPaginating || this.state.clientSyncState == 'PREPARED'
|
this.state.forwardPaginating ||
|
||||||
|
['PREPARED', 'CATCHUP'].includes(this.state.clientSyncState)
|
||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<MessagePanel ref="messagePanel"
|
<MessagePanel ref="messagePanel"
|
||||||
|
|
|
@ -87,7 +87,7 @@ module.exports = React.createClass({
|
||||||
if (this.unmounted) return;
|
if (this.unmounted) return;
|
||||||
|
|
||||||
// Consider the client reconnected if there is no error with syncing.
|
// Consider the client reconnected if there is no error with syncing.
|
||||||
// This means the state could be RECONNECTING, SYNCING or PREPARED.
|
// This means the state could be RECONNECTING, SYNCING, PREPARED or CATCHUP.
|
||||||
const reconnected = syncState !== "ERROR" && prevState !== syncState;
|
const reconnected = syncState !== "ERROR" && prevState !== syncState;
|
||||||
if (reconnected &&
|
if (reconnected &&
|
||||||
// Did we fall back?
|
// Did we fall back?
|
||||||
|
|
|
@ -76,7 +76,7 @@ export default class MImageBody extends React.Component {
|
||||||
onClientSync(syncState, prevState) {
|
onClientSync(syncState, prevState) {
|
||||||
if (this.unmounted) return;
|
if (this.unmounted) return;
|
||||||
// Consider the client reconnected if there is no error with syncing.
|
// Consider the client reconnected if there is no error with syncing.
|
||||||
// This means the state could be RECONNECTING, SYNCING or PREPARED.
|
// This means the state could be RECONNECTING, SYNCING, PREPARED or CATCHUP.
|
||||||
const reconnected = syncState !== "ERROR" && prevState !== syncState;
|
const reconnected = syncState !== "ERROR" && prevState !== syncState;
|
||||||
if (reconnected && this.state.imgError) {
|
if (reconnected && this.state.imgError) {
|
||||||
// Load the image again
|
// Load the image again
|
||||||
|
|
Loading…
Reference in a new issue