Fix an issue with the core updater

This commit is contained in:
Zack Rauen 2022-10-15 18:15:03 -04:00
parent 1dd9df2f48
commit f0bf331933
2 changed files with 5 additions and 3 deletions

View File

@ -21,7 +21,8 @@ export default {
items: [ items: [
"Fixed a few issues with our context menu api.", "Fixed a few issues with our context menu api.",
"Fixed an issue in our API that could lead to styles not being removed correctly.", "Fixed an issue in our API that could lead to styles not being removed correctly.",
"Fixed an issue where `getOwnerInstance` would cause an error." "Fixed an issue where `getOwnerInstance` would cause an error.",
"Fixed an issue with the core updater not updating on click."
] ]
} }
] ]

View File

@ -12,7 +12,7 @@ class CoreUpdaterPanel extends React.Component {
return <Drawer name="BetterDiscord" collapsible={true}> return <Drawer name="BetterDiscord" collapsible={true}>
<SettingItem name={`Core v${Config.version}`} note={this.props.hasUpdate ? Strings.Updater.versionAvailable.format({version: this.props.remoteVersion}) : Strings.Updater.noUpdatesAvailable} inline={true} id={"core-updater"}> <SettingItem name={`Core v${Config.version}`} note={this.props.hasUpdate ? Strings.Updater.versionAvailable.format({version: this.props.remoteVersion}) : Strings.Updater.noUpdatesAvailable} inline={true} id={"core-updater"}>
{!this.props.hasUpdate && <div className="bd-filled-checkmark"><Checkmark /></div>} {!this.props.hasUpdate && <div className="bd-filled-checkmark"><Checkmark /></div>}
{this.props.hasUpdate && <button className="bd-button">{Strings.Updater.updateButton}</button>} {this.props.hasUpdate && <button className="bd-button" onClick={this.props.update}>{Strings.Updater.updateButton}</button>}
</SettingItem> </SettingItem>
</Drawer>; </Drawer>;
} }
@ -55,6 +55,7 @@ export default class UpdaterPanel extends React.Component {
this.checkForUpdates = this.checkForUpdates.bind(this); this.checkForUpdates = this.checkForUpdates.bind(this);
this.updateAddon = this.updateAddon.bind(this); this.updateAddon = this.updateAddon.bind(this);
this.updateCore = this.updateCore.bind(this);
this.updateAllAddons = this.updateAllAddons.bind(this); this.updateAllAddons = this.updateAllAddons.bind(this);
this.update = this.update.bind(this); this.update = this.update.bind(this);
} }
@ -121,7 +122,7 @@ export default class UpdaterPanel extends React.Component {
render() { render() {
return [ return [
<SettingsTitle text={Strings.Panels.updates} button={{title: Strings.Updater.checkForUpdates, onClick: this.checkForUpdates}} />, <SettingsTitle text={Strings.Panels.updates} button={{title: Strings.Updater.checkForUpdates, onClick: this.checkForUpdates}} />,
<CoreUpdaterPanel remoteVersion={this.props.coreUpdater.remoteVersion} hasUpdate={this.state.hasCoreUpdate} />, <CoreUpdaterPanel remoteVersion={this.props.coreUpdater.remoteVersion} hasUpdate={this.state.hasCoreUpdate} update={this.updateCore} />,
<AddonUpdaterPanel type="plugins" pending={this.state.plugins} update={this.updateAddon} updateAll={this.updateAllAddons} updater={this.props.pluginUpdater} />, <AddonUpdaterPanel type="plugins" pending={this.state.plugins} update={this.updateAddon} updateAll={this.updateAllAddons} updater={this.props.pluginUpdater} />,
<AddonUpdaterPanel type="themes" pending={this.state.themes} update={this.updateAddon} updateAll={this.updateAllAddons} updater={this.props.themeUpdater} />, <AddonUpdaterPanel type="themes" pending={this.state.themes} update={this.updateAddon} updateAll={this.updateAllAddons} updater={this.props.themeUpdater} />,
]; ];