mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-08 20:06:32 +00:00
Fixed a selection bug after installing a core/lib
Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
parent
62b18ccbed
commit
a9c9dcde7b
@ -16,7 +16,18 @@ export class ComponentListItem<T extends ArduinoComponent> extends React.Compone
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected async install(item: T): Promise<void> {
|
protected async install(item: T): Promise<void> {
|
||||||
await this.props.install(item, this.state.selectedVersion);
|
const toInstall = this.state.selectedVersion;
|
||||||
|
const version = this.props.item.availableVersions.filter(version => version !== this.state.selectedVersion)[0];
|
||||||
|
this.setState({
|
||||||
|
selectedVersion: version
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
await this.props.install(item, toInstall);
|
||||||
|
} catch {
|
||||||
|
this.setState({
|
||||||
|
selectedVersion: toInstall
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async uninstall(item: T): Promise<void> {
|
protected async uninstall(item: T): Promise<void> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user