From 252cd3d377aafbc8abecbb043e1909dc69c2e9fe Mon Sep 17 00:00:00 2001 From: PhilReact Date: Mon, 5 May 2025 01:31:15 +0300 Subject: [PATCH] fix local storage data --- package.json | 2 +- src/context/GlobalProvider.tsx | 2 +- src/hooks/usePersistentStore.tsx | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 862c6ec..d794fd8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "qapp-core", - "version": "1.0.25", + "version": "1.0.26", "description": "Qortal's core React library with global state, UI components, and utilities", "main": "dist/index.js", "module": "dist/index.mjs", diff --git a/src/context/GlobalProvider.tsx b/src/context/GlobalProvider.tsx index 491fb7c..ed8e90a 100644 --- a/src/context/GlobalProvider.tsx +++ b/src/context/GlobalProvider.tsx @@ -48,7 +48,7 @@ export const GlobalProvider = ({ children, config, toastStyle = {} }: GlobalProv const appInfo = useAppInfo(config.appName, config?.publicSalt) const lists = useResources() const identifierOperations = useIdentifiers(config.publicSalt, config.appName) - const persistentOperations = usePersistentStore(config.publicSalt, config.appName, auth?.address) + const persistentOperations = usePersistentStore(config.publicSalt, config.appName) const indexOperations = useIndexes() // ✅ Merge all hooks into a single `contextValue` const contextValue = useMemo(() => ({ auth, lists, appInfo, identifierOperations, persistentOperations, indexOperations }), [auth, lists, appInfo, identifierOperations, persistentOperations]); diff --git a/src/hooks/usePersistentStore.tsx b/src/hooks/usePersistentStore.tsx index 5c4f116..69eb3b0 100644 --- a/src/hooks/usePersistentStore.tsx +++ b/src/hooks/usePersistentStore.tsx @@ -4,15 +4,14 @@ import { db } from '../utils/persistentDb'; export const usePersistentStore = ( publicSalt: string, - appName: string, - qortalAddress?: string | null + appName: string ) => { const getHashedId = useCallback( async (id: string) => { - const key = `${appName}-${qortalAddress ?? 'no-address'}-${id}`; + const key = `${appName}-${id}`; return await hashWord(key, EnumCollisionStrength.HIGH, publicSalt); }, - [appName, publicSalt, qortalAddress] + [appName, publicSalt] ); // --- TIMESTAMP FUNCTIONS ---