mirror of
https://github.com/Kong/insomnia.git
synced 2026-10-13 06:37:47 -04:00
Fix check-for-updates button
This commit is contained in:
1 parent
b1afb511b5
commit
c43e3b64f4
1 file changed
+3
-15
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user