Skip to content

Commit

Permalink
Re query audiofill on change
Browse files Browse the repository at this point in the history
  • Loading branch information
aamirazad committed Aug 21, 2024
1 parent b919165 commit 0151d9b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/app/settings/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -263,13 +265,14 @@ export function Forms() {
setActiveTab={setActiveTab}
userData={userData}
/>,
<BodyMessage key="done">All done</BodyMessage>,
];
return (
<>
{formElements[activeTab]}
<ProgressIndicator
activeTab={activeTab}
totalTabs={formElements.length}
totalTabs={formElements.length - 1}
setActiveTab={setActiveTab}
/>
</>
Expand Down

0 comments on commit 0151d9b

Please sign in to comment.