Skip to content

Commit 6a5b222

Browse files
committed
Gate the update button on the selected channel
The confirm button was gated on the device-wide has_updates flag while the release panel was gated per channel, so picking a channel with no firmware left the button live and sent the device an update it had nothing to install. Gate both on the same per-channel lookup, and show a message where the release panel would be when the channel is empty. The local source stays exempt: it resolves the release from the Shelly firmware index rather than from what the device reported.
1 parent 48bfc7e commit 6a5b222

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

packages/web/src/components/device-detail/device-actions.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,15 @@ export function DeviceActions({
261261
)}
262262
</div>
263263
)}
264+
265+
{updateSource === "internet" &&
266+
!availableUpdates[updateChannel] && (
267+
<div className="p-3 bg-muted rounded-lg text-sm text-muted-foreground">
268+
{t(
269+
"deviceDetail.dialogs.updateFirmware.noReleaseOnChannel",
270+
)}
271+
</div>
272+
)}
264273
</div>
265274

266275
<DialogFooter>
@@ -279,7 +288,8 @@ export function DeviceActions({
279288
}
280289
disabled={
281290
updateMutation.isPending ||
282-
(updateSource === "internet" && !hasUpdates)
291+
(updateSource === "internet" &&
292+
!availableUpdates[updateChannel])
283293
}
284294
>
285295
{updateMutation.isPending

packages/web/src/i18n/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,8 @@
410410
"version": "Version",
411411
"firmwareUpdate": "Firmware Update",
412412
"startingUpdate": "Starting Update...",
413-
"startUpdate": "Start Update"
413+
"startUpdate": "Start Update",
414+
"noReleaseOnChannel": "No firmware published on this channel for this device."
414415
},
415416
"rebootDevice": {
416417
"title": "Reboot Device",

0 commit comments

Comments
 (0)