Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Hide clear cache and reload button if crash is before client init #7242

Merged
merged 3 commits into from
Dec 1, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/components/structures/LoggedInView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ interface IState {
class LoggedInView extends React.Component<IProps, IState> {
static displayName = 'LoggedInView';

private dispatcherRef: string;
protected readonly _matrixClient: MatrixClient;
protected readonly _roomView: React.RefObject<any>;
protected readonly _resizeContainer: React.RefObject<HTMLDivElement>;
Expand Down Expand Up @@ -213,7 +212,6 @@ class LoggedInView extends React.Component<IProps, IState> {
componentWillUnmount() {
document.removeEventListener('keydown', this.onNativeKeyDown, false);
CallHandler.instance.removeListener(CallHandlerEvent.CallState, this.onCallState);
dis.unregister(this.dispatcherRef);
this._matrixClient.removeListener("accountData", this.onAccountData);
this._matrixClient.removeListener("sync", this.onSync);
this._matrixClient.removeListener("RoomState.events", this.onRoomStateEvents);
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/elements/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ export default class ErrorBoundary extends React.PureComponent<{}, IState> {
<div className="mx_ErrorBoundary_body">
<h1>{ _t("Something went wrong!") }</h1>
{ bugReportSection }
<AccessibleButton onClick={this.onClearCacheAndReload} kind='danger'>
{ MatrixClientPeg.get() && <AccessibleButton onClick={this.onClearCacheAndReload} kind='danger'>
t3chguy marked this conversation as resolved.
Show resolved Hide resolved
{ _t("Clear cache and reload") }
</AccessibleButton>
</AccessibleButton> }
</div>
</div>;
}
Expand Down