From f4f2b45d2ba42e9f976abf84e22bc143448c5029 Mon Sep 17 00:00:00 2001 From: Andrew Dryga Date: Thu, 5 Sep 2024 18:45:39 -0700 Subject: [PATCH] fix(portal): Reload client on updates (#6614) --- elixir/apps/api/lib/api/client/channel.ex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/elixir/apps/api/lib/api/client/channel.ex b/elixir/apps/api/lib/api/client/channel.ex index 516401e24..3bc377935 100644 --- a/elixir/apps/api/lib/api/client/channel.ex +++ b/elixir/apps/api/lib/api/client/channel.ex @@ -76,6 +76,7 @@ defmodule API.Client.Channel do :ok = Resources.subscribe_to_events_for_resource(resource) end) + # Subscribe for known gateway group names so that if they are updated - we can render change in the UI :ok = resources |> Enum.flat_map(& &1.gateway_groups) @@ -152,6 +153,7 @@ defmodule API.Client.Channel do OpenTelemetry.Tracer.set_current_span(socket.assigns.opentelemetry_span_ctx) OpenTelemetry.Tracer.with_span "client.updated" do + socket = assign(socket, client: Clients.fetch_client_by_id!(socket.assigns.client.id)) :ok = init(socket) {:noreply, socket} end