mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
refactor(portal): don't store account assoc on client (#10009)
The full `account` struct is only used to render the client's interface, and doesn't need to be stored in the `client` struct when the `subject` struct already tracks it.
This commit is contained in:
@@ -169,10 +169,11 @@ defmodule API.Client.Channel do
|
||||
{:updated, %Accounts.Account{} = old_account, %Accounts.Account{} = account},
|
||||
socket
|
||||
) do
|
||||
socket = assign(socket, client: %{socket.assigns.client | account: account})
|
||||
# update our cached subject's account
|
||||
socket = assign(socket, subject: %{socket.assigns.subject | account: account})
|
||||
|
||||
if old_account.config != account.config do
|
||||
payload = %{interface: Views.Interface.render(socket.assigns.client)}
|
||||
payload = %{interface: Views.Interface.render(%{socket.assigns.client | account: account})}
|
||||
:ok = push(socket, "config_changed", payload)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user