Hide clear cache and reload button if crash is before client init (#7242)
This commit is contained in:
parent
5ba2d16ee1
commit
a4714829f7
2 changed files with 10 additions and 6 deletions
|
@ -106,13 +106,19 @@ export default class ErrorBoundary extends React.PureComponent<{}, IState> {
|
|||
</React.Fragment>;
|
||||
}
|
||||
|
||||
let clearCacheButton: JSX.Element;
|
||||
// we only show this button if there is an initialised MatrixClient otherwise we can't clear the cache
|
||||
if (MatrixClientPeg.get()) {
|
||||
clearCacheButton = <AccessibleButton onClick={this.onClearCacheAndReload} kind='danger'>
|
||||
{ _t("Clear cache and reload") }
|
||||
</AccessibleButton>;
|
||||
}
|
||||
|
||||
return <div className="mx_ErrorBoundary">
|
||||
<div className="mx_ErrorBoundary_body">
|
||||
<h1>{ _t("Something went wrong!") }</h1>
|
||||
{ bugReportSection }
|
||||
<AccessibleButton onClick={this.onClearCacheAndReload} kind='danger'>
|
||||
{ _t("Clear cache and reload") }
|
||||
</AccessibleButton>
|
||||
{ clearCacheButton }
|
||||
</div>
|
||||
</div>;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue