Skip to content

Commit c926042

Browse files
authored
Make sure firmware is selected when processing push-update (#1863)
Fixes a UI/UX use case where the 'send update' button can be pressed even though no firmware has been selected.
1 parent f001eb5 commit c926042

File tree

1 file changed

+6
-0
lines changed
  • lib/nerves_hub_web/components/device_page

1 file changed

+6
-0
lines changed

lib/nerves_hub_web/components/device_page/details.ex

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,12 @@ defmodule NervesHubWeb.Components.DevicePage.Details do
546546
end
547547
end
548548

549+
def handle_event("push-update", %{"uuid" => uuid}, socket) when uuid == "" do
550+
socket
551+
|> send_toast(:error, "Please select a firmware version to send to the device.")
552+
|> noreply()
553+
end
554+
549555
def handle_event("push-update", %{"uuid" => uuid}, socket) do
550556
authorized!(:"device:push-update", socket.assigns.org_user)
551557

0 commit comments

Comments
 (0)