mirror of
https://github.com/Qortal/qapp-core.git
synced 2025-06-14 17:41:20 +00:00
fix local storage data
This commit is contained in:
parent
0fbfc8a327
commit
252cd3d377
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "qapp-core",
|
"name": "qapp-core",
|
||||||
"version": "1.0.25",
|
"version": "1.0.26",
|
||||||
"description": "Qortal's core React library with global state, UI components, and utilities",
|
"description": "Qortal's core React library with global state, UI components, and utilities",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"module": "dist/index.mjs",
|
"module": "dist/index.mjs",
|
||||||
|
@ -48,7 +48,7 @@ export const GlobalProvider = ({ children, config, toastStyle = {} }: GlobalProv
|
|||||||
const appInfo = useAppInfo(config.appName, config?.publicSalt)
|
const appInfo = useAppInfo(config.appName, config?.publicSalt)
|
||||||
const lists = useResources()
|
const lists = useResources()
|
||||||
const identifierOperations = useIdentifiers(config.publicSalt, config.appName)
|
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()
|
const indexOperations = useIndexes()
|
||||||
// ✅ Merge all hooks into a single `contextValue`
|
// ✅ Merge all hooks into a single `contextValue`
|
||||||
const contextValue = useMemo(() => ({ auth, lists, appInfo, identifierOperations, persistentOperations, indexOperations }), [auth, lists, appInfo, identifierOperations, persistentOperations]);
|
const contextValue = useMemo(() => ({ auth, lists, appInfo, identifierOperations, persistentOperations, indexOperations }), [auth, lists, appInfo, identifierOperations, persistentOperations]);
|
||||||
|
@ -4,15 +4,14 @@ import { db } from '../utils/persistentDb';
|
|||||||
|
|
||||||
export const usePersistentStore = (
|
export const usePersistentStore = (
|
||||||
publicSalt: string,
|
publicSalt: string,
|
||||||
appName: string,
|
appName: string
|
||||||
qortalAddress?: string | null
|
|
||||||
) => {
|
) => {
|
||||||
const getHashedId = useCallback(
|
const getHashedId = useCallback(
|
||||||
async (id: string) => {
|
async (id: string) => {
|
||||||
const key = `${appName}-${qortalAddress ?? 'no-address'}-${id}`;
|
const key = `${appName}-${id}`;
|
||||||
return await hashWord(key, EnumCollisionStrength.HIGH, publicSalt);
|
return await hashWord(key, EnumCollisionStrength.HIGH, publicSalt);
|
||||||
},
|
},
|
||||||
[appName, publicSalt, qortalAddress]
|
[appName, publicSalt]
|
||||||
);
|
);
|
||||||
|
|
||||||
// --- TIMESTAMP FUNCTIONS ---
|
// --- TIMESTAMP FUNCTIONS ---
|
||||||
|
Loading…
x
Reference in New Issue
Block a user