From 5143020ffbcd3cf757369ab4dc74138071718df8 Mon Sep 17 00:00:00 2001 From: Zacck Date: Fri, 11 Aug 2023 09:09:30 +0200 Subject: [PATCH 1/2] Fix hanging downloads with link --- lib/lightning_web/live/project_live/settings.html.heex | 8 +++----- test/lightning_web/live/project_live_test.exs | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/lightning_web/live/project_live/settings.html.heex b/lib/lightning_web/live/project_live/settings.html.heex index 346178f4bc..15b89c71bc 100644 --- a/lib/lightning_web/live/project_live/settings.html.heex +++ b/lib/lightning_web/live/project_live/settings.html.heex @@ -130,14 +130,12 @@ - + <%= if @can_delete_project do %> diff --git a/test/lightning_web/live/project_live_test.exs b/test/lightning_web/live/project_live_test.exs index 053b00cb34..e99e723bb4 100644 --- a/test/lightning_web/live/project_live_test.exs +++ b/test/lightning_web/live/project_live_test.exs @@ -132,10 +132,10 @@ defmodule LightningWeb.ProjectLiveTest do assert html =~ "Export your project as code, to save this version or edit your project locally" - assert index_live |> element("button", "Export project") |> has_element?() + assert index_live |> element("a", "Export project") |> has_element?() assert index_live - |> element("button", "Export project") + |> element("a", "Export project") |> render_click() |> follow_redirect(conn, "/download/yaml?id=#{project.id}") end From 1282c39544762b199774bb388c10852f184cd685 Mon Sep 17 00:00:00 2001 From: Stuart Corbishley Date: Mon, 14 Aug 2023 10:44:40 +0200 Subject: [PATCH 2/2] Remove unused event handler --- lib/lightning_web/live/project_live/settings.ex | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/lightning_web/live/project_live/settings.ex b/lib/lightning_web/live/project_live/settings.ex index abf7f36cb3..0c3c4cb9d9 100644 --- a/lib/lightning_web/live/project_live/settings.ex +++ b/lib/lightning_web/live/project_live/settings.ex @@ -183,10 +183,6 @@ defmodule LightningWeb.ProjectLive.Settings do end end - def handle_event("export_project", %{"id" => id}, socket) do - {:noreply, push_navigate(socket, to: "/download/yaml?id=#{id}")} - end - defp dispatch_flash(change_result, socket) do case change_result do {:ok, %ProjectUser{}} ->