mirror of
https://github.com/zkldi/Tachi.git
synced 2026-09-30 10:58:07 +03:00
Never cache ARCIntegration info
This commit is contained in:
@@ -16,7 +16,7 @@ export default function ARCIntegrationPage({ reqUser }: { reqUser: PublicUserDoc
|
||||
const { data, isLoading, error } = useApiQuery<{
|
||||
iidx: ARCSavedProfileDocument | null;
|
||||
sdvx: ARCSavedProfileDocument | null;
|
||||
}>(`/users/${reqUser.id}/integrations/arc`);
|
||||
}>(`/users/${reqUser.id}/integrations/arc`, undefined, true);
|
||||
|
||||
useEffect(() => {
|
||||
if (data) {
|
||||
|
||||
@@ -2,7 +2,11 @@ import { useQuery } from "react-query";
|
||||
import { SuccessfulAPIResponse } from "tachi-common";
|
||||
import { APIFetchV1, UnsuccessfulAPIFetchResponse } from "util/api";
|
||||
|
||||
export default function useApiQuery<T>(url: string | string[], options?: RequestInit) {
|
||||
export default function useApiQuery<T>(
|
||||
url: string | string[],
|
||||
options?: RequestInit,
|
||||
neverCache = false
|
||||
) {
|
||||
return useQuery<T, UnsuccessfulAPIFetchResponse>(
|
||||
url,
|
||||
async () => {
|
||||
@@ -25,7 +29,7 @@ export default function useApiQuery<T>(url: string | string[], options?: Request
|
||||
return res.body;
|
||||
},
|
||||
{
|
||||
retry: (options?.method ?? "GET") === "GET",
|
||||
retry: (options?.method ?? "GET") === "GET" && !neverCache,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user