Redesign mobile time clock, add shortcuts, and improve account management.
Add iOS Shortcuts/Siri intents, local send-reminder notifications, stable client picker with last-client defaults, account refresh/remove, and softer session handling on unauthorized API responses. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { MutationCache, QueryCache, QueryClient } from "@tanstack/react-query";
|
||||
|
||||
import { isUnauthorizedError } from "@/lib/trpc-errors";
|
||||
|
||||
export function createAppQueryClient(onUnauthorized: () => void) {
|
||||
const handleError = (error: unknown) => {
|
||||
if (isUnauthorizedError(error)) {
|
||||
onUnauthorized();
|
||||
}
|
||||
};
|
||||
|
||||
return new QueryClient({
|
||||
queryCache: new QueryCache({ onError: handleError }),
|
||||
mutationCache: new MutationCache({ onError: handleError }),
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
staleTime: 30_000,
|
||||
retry: (failureCount, error) => {
|
||||
if (isUnauthorizedError(error)) return false;
|
||||
return failureCount < 1;
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user