From 53197858553b580834383abaa911bea87c74bf83 Mon Sep 17 00:00:00 2001 From: Thelonius Kort Date: Fri, 3 Mar 2023 21:57:09 +0100 Subject: [PATCH] Update continue_edit() to reload Translation Reloading is necessary to detect changes in the changeset. Otherwise simple changes like changing the value of translation.public wouldn't get noticed and not being saved to db. --- lib/outlook_web/live/translation_live/form_component.ex | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/outlook_web/live/translation_live/form_component.ex b/lib/outlook_web/live/translation_live/form_component.ex index 9bcec64..c79ce1d 100644 --- a/lib/outlook_web/live/translation_live/form_component.ex +++ b/lib/outlook_web/live/translation_live/form_component.ex @@ -187,6 +187,7 @@ defmodule OutlookWeb.TranslationLive.FormComponent do defp continue_edit(socket, :edit, %{"continue_edit" => "true"}) do socket + |> assign(:translation, Translations.get_translation!(socket.assigns.translation.id)) end defp continue_edit(socket, :new, %{"continue_edit" => "true"} = params) do socket |> push_patch(to: ~p(/translations/#{params["id"]}/edit))