Skip to content

Commit

Permalink
feat: live dashboard? (untested :3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sampiiiii committed Apr 15, 2024
1 parent 414713a commit 5b02607
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions apps/forge/src/components/signin/dashboard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ export default function SignInDashboard() {

const handleRemoveSignedInUser = (userId: string) => {
setSignedInUsers((currentUsers) => currentUsers.filter((user) => user.user.id !== userId));
queryClient.invalidateQueries({ queryKey: ["locationStatus"] });
queryClient.invalidateQueries({ queryKey: ["locationStatus", "locationList", { activeLocation }] });
};

const handleRemoveSignedInRep = (userId: string) => {
setSignedInReps((currentReps) => currentReps.filter((rep) => rep.user.id !== userId));
queryClient.invalidateQueries({ queryKey: ["locationStatus"] });
queryClient.invalidateQueries({ queryKey: ["locationStatus", "locationList", { activeLocation }] });
};

const {
Expand All @@ -37,6 +37,9 @@ export default function SignInDashboard() {
} = useQuery({
queryKey: ["locationList", activeLocation],
queryFn: () => dataForLocation(activeLocation),
staleTime: 5_000,
refetchInterval: 60_000,
refetchOnWindowFocus: true,
});

useEffect(() => {
Expand Down

0 comments on commit 5b02607

Please sign in to comment.