Fix check-for-updates button

This commit is contained in:
Gregory Schier committed 2017-11-22 22:43:10 +00:00
1 parent b1afb511b5
commit c43e3b64f4
1 file changed
+3 -15
+3 -15
View File
@@ -44,23 +44,11 @@ class CheckForUpdatesButton extends React.PureComponent<Props, State> {
render () {
const {children, className} = this.props;
const {status, checking, updateAvailable} = this.state;
let toShow = children;
if (checking) {
toShow = status || children;
}
if (updateAvailable) {
toShow = status;
}
const {status, checking} = this.state;
return (
<button className={className}
disabled={status || updateAvailable}
onClick={this._handleCheckForUpdates}>
{toShow}
<button className={className} disabled={checking} onClick={this._handleCheckForUpdates}>
{status || children}
</button>
);
}