From 0151d9bf6df207378146febcdccfaba17f972eae Mon Sep 17 00:00:00 2001 From: Aamir Azad Date: Tue, 20 Aug 2024 21:53:32 -0400 Subject: [PATCH] Re query audiofill on change --- src/app/settings/page.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/settings/page.tsx b/src/app/settings/page.tsx index 13b6eca..538ad7b 100644 --- a/src/app/settings/page.tsx +++ b/src/app/settings/page.tsx @@ -33,10 +33,10 @@ import { Card, CardContent, CardDescription, - CardFooter, CardHeader, CardTitle, } from "@/components/ui/card"; +import BodyMessage from "@/components/body-message"; const queryClient = new QueryClient(); @@ -68,6 +68,7 @@ function PaperlessCard({ setActiveTab, userData }: FormProps) { await setUserProperty("paperlessToken", values.PaperlessToken); // Operation succeeded, show success toast toast("Your paperless preferences was saved"); + void queryClient.invalidateQueries({ queryKey: ["userData"] }); // Optionally, move to a new tab or take another action to indicate success } catch { // Operation failed, show error toast @@ -171,6 +172,7 @@ function WhishperURL({ setActiveTab, userData }: FormProps) { await setUserProperty("whishperURL", values.URL); // Operation succeeded, show success toast toast("Your whishper URL preferences was saved"); + void queryClient.invalidateQueries({ queryKey: ["userData"] }); // Optionally, move to a new tab or take another action to indicate success } catch { // Operation failed, show error toast @@ -263,13 +265,14 @@ export function Forms() { setActiveTab={setActiveTab} userData={userData} />, + All done, ]; return ( <> {formElements[activeTab]}