Replace missed occurrences with koration

This commit is contained in:
schroda
2025-11-09 01:13:31 +01:00
parent 490ebb5bde
commit cdab741ce5

View File

@@ -27,6 +27,7 @@ import {
} from '@apollo/client'; } from '@apollo/client';
import { MaybeMasked, OperationVariables, Reference } from '@apollo/client/core'; import { MaybeMasked, OperationVariables, Reference } from '@apollo/client/core';
import { useEffect, useMemo, useRef, useState } from 'react'; import { useEffect, useMemo, useRef, useState } from 'react';
import { d } from 'koration';
import { IRestClient, RestClient } from '@/lib/requests/client/RestClient.ts'; import { IRestClient, RestClient } from '@/lib/requests/client/RestClient.ts';
import { GraphQLClient } from '@/lib/requests/client/GraphQLClient.ts'; import { GraphQLClient } from '@/lib/requests/client/GraphQLClient.ts';
import { BaseClient } from '@/lib/requests/client/BaseClient.ts'; import { BaseClient } from '@/lib/requests/client/BaseClient.ts';
@@ -569,7 +570,7 @@ export class RequestManager {
const isFirstPage = pageToRevalidate === 1; const isFirstPage = pageToRevalidate === 1;
const isTtlReached = const isTtlReached =
Date.now() - (this.cache.getFetchTimestampFor(cacheResultsKey, getVariablesFor(pageToRevalidate)) ?? 0) >= Date.now() - (this.cache.getFetchTimestampFor(cacheResultsKey, getVariablesFor(pageToRevalidate)) ?? 0) >=
1000 * 60 * 5; d(5).minutes.inWholeMilliseconds;
if (isFirstPage && !isTtlReached) { if (isFirstPage && !isTtlReached) {
return; return;
@@ -1362,7 +1363,11 @@ export class RequestManager {
setUpdatedCache({}); setUpdatedCache({});
}, [result.loading]); }, [result.loading]);
const cachedResult = this.cache.getResponseFor<typeof result>(EXTENSION_LIST_CACHE_KEY, undefined, 1000 * 60); const cachedResult = this.cache.getResponseFor<typeof result>(
EXTENSION_LIST_CACHE_KEY,
undefined,
d(1).minutes.inWholeMilliseconds,
);
const normalizedCachedResult = useMemo( const normalizedCachedResult = useMemo(
() => () =>
!cachedResult !cachedResult