Factor out clearStorageButton
This commit is contained in:
parent
5d46efc3e8
commit
54cccab0c7
1 changed files with 8 additions and 6 deletions
|
@ -58,6 +58,12 @@ export default React.createClass({
|
||||||
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
|
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
|
||||||
const DialogButtons = sdk.getComponent('views.elements.DialogButtons');
|
const DialogButtons = sdk.getComponent('views.elements.DialogButtons');
|
||||||
|
|
||||||
|
const clearStorageButton = (
|
||||||
|
<button onClick={this._onClearStorageClick} className="danger">
|
||||||
|
{ _t("Clear Storage and Sign Out") }
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
|
||||||
let dialogButtons;
|
let dialogButtons;
|
||||||
if (SdkConfig.get().bug_report_endpoint_url) {
|
if (SdkConfig.get().bug_report_endpoint_url) {
|
||||||
dialogButtons = <DialogButtons primaryButton={_t("Send Logs")}
|
dialogButtons = <DialogButtons primaryButton={_t("Send Logs")}
|
||||||
|
@ -65,9 +71,7 @@ export default React.createClass({
|
||||||
focus={true}
|
focus={true}
|
||||||
hasCancel={false}
|
hasCancel={false}
|
||||||
>
|
>
|
||||||
<button onClick={this._onClearStorageClick} className="danger">
|
{clearStorageButton}
|
||||||
{ _t("Clear Storage and Sign Out") }
|
|
||||||
</button>
|
|
||||||
</DialogButtons>;
|
</DialogButtons>;
|
||||||
} else {
|
} else {
|
||||||
dialogButtons = <DialogButtons primaryButton={_t("Refresh")}
|
dialogButtons = <DialogButtons primaryButton={_t("Refresh")}
|
||||||
|
@ -75,9 +79,7 @@ export default React.createClass({
|
||||||
focus={true}
|
focus={true}
|
||||||
hasCancel={false}
|
hasCancel={false}
|
||||||
>
|
>
|
||||||
<button onClick={this._onClearStorageClick} className="danger">
|
{clearStorageButton}
|
||||||
{ _t("Clear Storage and Sign Out") }
|
|
||||||
</button>
|
|
||||||
</DialogButtons>;
|
</DialogButtons>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue