-
Updating firmware...
+
+ {this.state.updaterId === UpdaterId.Firmware && (
+
Updating Firmware...
+ )}
+ {this.state.updaterId === UpdaterId.UI && (
+
Updating UI...
+ )}
+
Please do not power off or reboot the device
@@ -216,10 +232,7 @@ export class UpdateComponent
-
- Update successfully finished. Check updated firmware version in
- System Status card.
-
+
Update successfully finished.
);
@@ -274,6 +287,7 @@ export class UpdateComponent
selectedFile: file,
updateError: null,
updateFinished: false,
+ updaterId: UpdaterId.None,
});
};
@@ -283,6 +297,7 @@ export class UpdateComponent
selectedFile: null,
updateError: null,
updateFinished: false,
+ updaterId: UpdaterId.None,
});
if (this.fileInput) {
this.fileInput.value = "";
@@ -297,9 +312,23 @@ export class UpdateComponent
const buffer = await this.state.selectedFile.arrayBuffer();
const data = new Uint8Array(buffer);
- this.setState({ ...this.state, isUpdating: true, updateError: null });
+ let error: Error | null = null;
+
+ const selectResult: UpdaterSelectorResult =
+ this.props.updaterSelector.select(this.state.selectedFile.name);
- const error = await this.props.updater.update(data);
+ this.setState({
+ ...this.state,
+ isUpdating: true,
+ updateError: null,
+ updaterId: selectResult.id,
+ });
+
+ if (!selectResult.error) {
+ error = await selectResult.updater!.update(data);
+ } else {
+ error = selectResult.error;
+ }
if (error) {
const errorMessage = `Update failed: ${error}`;
console.error(`update_component: update failed: ${error}`);