Skip to content

Commit c83a9d2

Browse files
committed
Remove dead code: unused callbacks in :edit action
The on_save and on_close callbacks are never passed when editing keychain credentials. Only credential_index uses :edit action, and it does not provide these callbacks. Removed the unreachable code.
1 parent 76cf5f3 commit c83a9d2

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

lib/lightning_web/live/credential_live/keychain_credential_form_component.ex

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -124,24 +124,11 @@ defmodule LightningWeb.CredentialLive.KeychainCredentialFormComponent do
124124
socket.assigns.keychain_credential,
125125
params
126126
) do
127-
{:ok, keychain_credential} ->
128-
socket =
129-
socket
130-
|> put_flash(:info, "Keychain credential updated successfully")
131-
|> push_event("close_modal", %{id: socket.assigns.id})
132-
127+
{:ok, _keychain_credential} ->
133128
{:noreply,
134-
then(socket, fn socket ->
135-
if socket.assigns[:on_save] do
136-
socket.assigns[:on_save].(keychain_credential)
137-
end
138-
139-
if socket.assigns[:on_close] do
140-
socket.assigns.on_close.()
141-
end
142-
143-
socket
144-
end)}
129+
socket
130+
|> put_flash(:info, "Keychain credential updated successfully")
131+
|> push_event("close_modal", %{id: socket.assigns.id})}
145132

146133
{:error, %Ecto.Changeset{} = changeset} ->
147134
{:noreply, assign(socket, :changeset, changeset)}

0 commit comments

Comments
 (0)