From 9a538f86d78077b6808b6a586642789d10a15233 Mon Sep 17 00:00:00 2001 From: PhilReact Date: Mon, 7 Apr 2025 10:19:15 +0300 Subject: [PATCH] fixes --- src/components/ResourceList/ResourceListDisplay.tsx | 2 +- src/hooks/useResources.tsx | 4 +--- src/index.ts | 2 +- src/utils/encryption.ts | 6 ++++++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/ResourceList/ResourceListDisplay.tsx b/src/components/ResourceList/ResourceListDisplay.tsx index 12296c3..35eb6c7 100644 --- a/src/components/ResourceList/ResourceListDisplay.tsx +++ b/src/components/ResourceList/ResourceListDisplay.tsx @@ -181,7 +181,7 @@ const addItems = useListStore((s) => s.addItems); const parsedParams = {...(JSON.parse(memoizedParamsSearchNewData))}; parsedParams.identifier = generatedIdentifier parsedParams.after = lastItemTimestampRef.current - const responseData = await lists.fetchResourcesResultsOnly(parsedParams, listName, returnType); // Awaiting the async function + const responseData = await lists.fetchResourcesResultsOnly(parsedParams); // Awaiting the async function if(onNewData && responseData?.length > 0){ onNewData(true) } diff --git a/src/hooks/useResources.tsx b/src/hooks/useResources.tsx index 445717f..d060cbb 100644 --- a/src/hooks/useResources.tsx +++ b/src/hooks/useResources.tsx @@ -250,9 +250,7 @@ export const useResources = (retryAttempts: number = 2) => { const fetchResourcesResultsOnly = useCallback( async ( - params: QortalSearchParams, - listName: string, - returnType: ReturnType = 'JSON' + params: QortalSearchParams ): Promise => { let responseData: QortalMetadata[] = []; diff --git a/src/index.ts b/src/index.ts index 4fdbd39..e8383a1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -17,7 +17,7 @@ export { RequestQueueWithPromise } from './utils/queue'; export { GlobalProvider, useGlobal } from "./context/GlobalProvider"; export {usePublish} from "./hooks/usePublish" export {ResourceListDisplay} from "./components/ResourceList/ResourceListDisplay" -export {QortalSearchParams} from './types/interfaces/resources' +export {QortalSearchParams, QortalMetadata} from './types/interfaces/resources' export {ImagePicker} from './common/ImagePicker' export {useNameSearch} from './hooks/useNameSearch' export {Resource} from './hooks/useResources' diff --git a/src/utils/encryption.ts b/src/utils/encryption.ts index 35faa5f..c680e4d 100644 --- a/src/utils/encryption.ts +++ b/src/utils/encryption.ts @@ -17,6 +17,12 @@ export enum EnumCollisionStrength { ENTITY_LABEL = 6, } +const deprecatedSafeBase64 = (base64: string): string => + base64 +.replace(/\+/g, "-") +.replace(/\//g, "_") +.replace(/=+$/, "") + // Custom URL-safe replacements (reserving '-' and '_') const safeBase64 = (base64: string): string =>