fix(ui): suppress nudges while ui settings are loading

Gate nudgesDisabled on the ui-settings loading state so an admin with
disable_ui_nudges on doesn't see the survey prompt flash, and the
getInProductNudgesCall fetch doesn't fire, on a cold page load before
the flag resolves. Falls back to showing nudges if the fetch errors.
This commit is contained in:
ryan-crabbe-berri 2026-06-05 11:09:06 -07:00
parent 96d819ee7e
commit 920c1c0987

View file

@ -91,8 +91,8 @@ function CreateKeyPageContent() {
const [modelData, setModelData] = useState<any>({ data: [] });
const [createClicked, setCreateClicked] = useState<boolean>(false);
const { data: uiSettingsData } = useUISettings();
const nudgesDisabled = Boolean(uiSettingsData?.values?.disable_ui_nudges);
const { data: uiSettingsData, isLoading: uiSettingsLoading } = useUISettings();
const nudgesDisabled = uiSettingsLoading || Boolean(uiSettingsData?.values?.disable_ui_nudges);
// Survey state - always show by default
const [showSurveyPrompt, setShowSurveyPrompt] = useState(true);