feat: Improve handling of association name config
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Simon 2026-05-07 12:13:45 +02:00
parent 605a897045
commit 2443bc62ac
Signed by: simon
GPG key ID: 40E7A58C4AA1EDB2
9 changed files with 179 additions and 4 deletions

View file

@ -135,8 +135,11 @@ defmodule MvWeb.Layouts do
slot :inner_block, required: true
def app(assigns) do
# Single get_settings() for layout; derive club_name and join_form_enabled to avoid duplicate query.
%{club_name: club_name, join_form_enabled: join_form_enabled} = get_layout_settings()
# Single settings read for layout defaults.
# Use an explicitly provided club_name as source of truth to avoid stale
# values from cache reads immediately after a settings update in LiveViews.
%{club_name: fallback_club_name, join_form_enabled: join_form_enabled} = get_layout_settings()
club_name = assigns[:club_name] || fallback_club_name
# NOTE: Unprocessed count runs on every page load when join form is enabled; consider
# loading only on navigation or caching briefly if performance becomes an issue.