Skip to content

Commit ea913d9

Browse files
Fix bad firmware UI and ensure it comes up for bluetooth flow (#568)
1 parent 8576070 commit ea913d9

File tree

5 files changed

+3
-23
lines changed

5 files changed

+3
-23
lines changed

lang/ui.en.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -703,10 +703,6 @@
703703
"defaultMessage": "Firmware update required",
704704
"description": "Connection error dialog"
705705
},
706-
"firmware-outdated-skip": {
707-
"defaultMessage": "Skip and transfer manually",
708-
"description": "Connection error dialog content - firmware"
709-
},
710706
"get-started-action": {
711707
"defaultMessage": "Get started",
712708
"description": "Get started action"

src/components/BrokenFirmwareDialog.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,11 @@ interface BrokenFirmwareDialogProps {
2626
isOpen: boolean;
2727
onClose: () => void;
2828
onTryAgain: () => void;
29-
onSkip: () => void;
3029
}
3130

3231
const BrokenFirmwareDialog = ({
3332
isOpen,
3433
onClose,
35-
onSkip,
3634
onTryAgain,
3735
}: BrokenFirmwareDialogProps) => {
3836
const { supportLinks } = useDeployment();
@@ -100,9 +98,6 @@ const BrokenFirmwareDialog = ({
10098
<Button onClick={onClose} variant="secondary" size="lg">
10199
<FormattedMessage id="cancel-action" />
102100
</Button>
103-
<Button onClick={onSkip} variant="secondary" size="lg">
104-
<FormattedMessage id="firmware-outdated-skip" />
105-
</Button>
106101
<Button onClick={onTryAgain} variant="primary" size="lg">
107102
<FormattedMessage id="try-again-action" />
108103
</Button>

src/components/ConnectionFlowDialogs.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,6 @@ const ConnectionDialogs = () => {
211211
return (
212212
<BrokenFirmwareDialog
213213
{...dialogCommonProps}
214-
onSkip={() =>
215-
actions.setFlowStep(ConnectionFlowStep.ManualFlashingTutorial)
216-
}
217214
onTryAgain={actions.onTryAgain}
218215
/>
219216
);

src/connection-stage-actions.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,16 +150,14 @@ export class ConnectionStageActions {
150150
};
151151

152152
private handleConnectAndFlashFail = (result: ConnectAndFlashFailResult) => {
153+
if (result === ConnectResult.ErrorBadFirmware) {
154+
return this.setFlowStep(ConnectionFlowStep.BadFirmware);
155+
}
153156
if (this.stage.flowType === ConnectionFlowType.ConnectBluetooth) {
154157
downloadHex(bluetoothUniversalHex);
155158
return this.setFlowStep(ConnectionFlowStep.ManualFlashingTutorial);
156159
}
157-
158-
// TODO: Not sure if this is a good way of error handling because it means
159-
// there are 2 levels of switch statements to go through to provide UI
160160
switch (result) {
161-
case ConnectResult.ErrorBadFirmware:
162-
return this.setFlowStep(ConnectionFlowStep.BadFirmware);
163161
case ConnectResult.ErrorNoDeviceSelected:
164162
return this.setFlowStep(
165163
ConnectionFlowStep.TryAgainWebUsbSelectMicrobit

src/messages/ui.en.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,12 +1207,6 @@
12071207
"value": "Firmware update required"
12081208
}
12091209
],
1210-
"firmware-outdated-skip": [
1211-
{
1212-
"type": 0,
1213-
"value": "Skip and transfer manually"
1214-
}
1215-
],
12161210
"get-started-action": [
12171211
{
12181212
"type": 0,

0 commit comments

Comments
 (0)