From 0fbfc8a327fc3f649ccc17af0a62a37bde7c4eb6 Mon Sep 17 00:00:00 2001 From: PhilReact Date: Sun, 4 May 2025 20:32:05 +0300 Subject: [PATCH] usepublish fix --- package.json | 2 +- src/hooks/usePublish.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 9fad691..862c6ec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "qapp-core", - "version": "1.0.24", + "version": "1.0.25", "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/hooks/usePublish.tsx b/src/hooks/usePublish.tsx index 0714078..3ff4d3b 100644 --- a/src/hooks/usePublish.tsx +++ b/src/hooks/usePublish.tsx @@ -174,13 +174,13 @@ export const usePublish = ( [metadata] ); + useEffect(() => { - if (hasFetched.current) return; + if (metadata?.identifier && metadata?.name && metadata?.service) { - hasFetched.current = true; fetchPublish(metadata); } - }, [metadata, returnType]); + }, [metadata?.identifier, metadata?.service, metadata?.identifier, returnType]); const refetchData = useCallback(async ()=> { if(!metadata) throw new Error('usePublish is missing metadata')