Remove the Lazy Loading InvalidStoreError
Dialogs (#12358)
* remove the LL dialogs and the use of InvalidStoreError * remove strings
This commit is contained in:
parent
4a182e89b0
commit
ac62ce3e6c
5 changed files with 2 additions and 153 deletions
|
@ -27,7 +27,6 @@ import {
|
|||
SyncStateData,
|
||||
SyncState,
|
||||
} from "matrix-js-sdk/src/matrix";
|
||||
import { InvalidStoreError } from "matrix-js-sdk/src/errors";
|
||||
import { defer, IDeferred, QueryDict } from "matrix-js-sdk/src/utils";
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
import { throttle } from "lodash";
|
||||
|
@ -1484,9 +1483,6 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
|||
|
||||
cli.on(ClientEvent.Sync, (state: SyncState, prevState: SyncState | null, data?: SyncStateData) => {
|
||||
if (state === SyncState.Error || state === SyncState.Reconnecting) {
|
||||
if (data?.error instanceof InvalidStoreError) {
|
||||
Lifecycle.handleInvalidStoreError(data.error);
|
||||
}
|
||||
this.setState({ syncError: data?.error ?? null });
|
||||
} else if (this.state.syncError) {
|
||||
this.setState({ syncError: null });
|
||||
|
@ -2018,14 +2014,10 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
|||
/>
|
||||
);
|
||||
} else if (this.state.view === Views.LOGGED_IN) {
|
||||
// store errors stop the client syncing and require user intervention, so we'll
|
||||
// be showing a dialog. Don't show anything else.
|
||||
const isStoreError = this.state.syncError && this.state.syncError instanceof InvalidStoreError;
|
||||
|
||||
// `ready` and `view==LOGGED_IN` may be set before `page_type` (because the
|
||||
// latter is set via the dispatcher). If we don't yet have a `page_type`,
|
||||
// keep showing the spinner for now.
|
||||
if (this.state.ready && this.state.page_type && !isStoreError) {
|
||||
if (this.state.ready && this.state.page_type) {
|
||||
/* for now, we stuff the entirety of our props and state into the LoggedInView.
|
||||
* we should go through and figure out what we actually need to pass down, as well
|
||||
* as using something like redux to avoid having a billion bits of state kicking around.
|
||||
|
@ -2042,12 +2034,11 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
|
|||
);
|
||||
} else {
|
||||
// we think we are logged in, but are still waiting for the /sync to complete
|
||||
// Suppress `InvalidStoreError`s here, since they have their own error dialog.
|
||||
view = (
|
||||
<LoginSplashView
|
||||
matrixClient={MatrixClientPeg.safeGet()}
|
||||
onLogoutClick={this.onLogoutClick}
|
||||
syncError={isStoreError ? null : this.state.syncError}
|
||||
syncError={this.state.syncError}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue