diff --git a/frontend/src/pages/SettingsPage.tsx b/frontend/src/pages/SettingsPage.tsx index ad6e49b..5c5029f 100644 --- a/frontend/src/pages/SettingsPage.tsx +++ b/frontend/src/pages/SettingsPage.tsx @@ -834,10 +834,11 @@ function ProfileSection() { const saveMut = useMutation({ mutationFn: updateMyPreferences, - onSuccess: () => { - qc.invalidateQueries({ queryKey: ["me-prefs"] }); + onSuccess: (updatedMe) => { + // Update cache immediately with the response — no extra round-trip needed + qc.setQueryData(["me-prefs"], updatedMe); setDirty(false); - setJiraApiToken(""); // clear token field after save — it's now persisted + setJiraApiToken(""); // clear token field after save — it's persisted setToast({ msg: "Profile settings saved", type: "success" }); }, onError: () => setToast({ msg: "Failed to save", type: "error" }),