You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-21 07:42:09 +03:00
Factor out clearStorageButton
This commit is contained in:
@ -58,6 +58,12 @@ export default React.createClass({
|
||||
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
|
||||
const DialogButtons = sdk.getComponent('views.elements.DialogButtons');
|
||||
|
||||
const clearStorageButton = (
|
||||
<button onClick={this._onClearStorageClick} className="danger">
|
||||
{ _t("Clear Storage and Sign Out") }
|
||||
</button>
|
||||
);
|
||||
|
||||
let dialogButtons;
|
||||
if (SdkConfig.get().bug_report_endpoint_url) {
|
||||
dialogButtons = <DialogButtons primaryButton={_t("Send Logs")}
|
||||
@ -65,9 +71,7 @@ export default React.createClass({
|
||||
focus={true}
|
||||
hasCancel={false}
|
||||
>
|
||||
<button onClick={this._onClearStorageClick} className="danger">
|
||||
{ _t("Clear Storage and Sign Out") }
|
||||
</button>
|
||||
{clearStorageButton}
|
||||
</DialogButtons>;
|
||||
} else {
|
||||
dialogButtons = <DialogButtons primaryButton={_t("Refresh")}
|
||||
@ -75,9 +79,7 @@ export default React.createClass({
|
||||
focus={true}
|
||||
hasCancel={false}
|
||||
>
|
||||
<button onClick={this._onClearStorageClick} className="danger">
|
||||
{ _t("Clear Storage and Sign Out") }
|
||||
</button>
|
||||
{clearStorageButton}
|
||||
</DialogButtons>;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user