usepublish fix

This commit is contained in:
PhilReact 2025-05-04 20:32:05 +03:00
parent f0c1b956ac
commit 0fbfc8a327
2 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "qapp-core", "name": "qapp-core",
"version": "1.0.24", "version": "1.0.25",
"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",

View File

@ -174,13 +174,13 @@ export const usePublish = (
[metadata] [metadata]
); );
useEffect(() => { useEffect(() => {
if (hasFetched.current) return;
if (metadata?.identifier && metadata?.name && metadata?.service) { if (metadata?.identifier && metadata?.name && metadata?.service) {
hasFetched.current = true;
fetchPublish(metadata); fetchPublish(metadata);
} }
}, [metadata, returnType]); }, [metadata?.identifier, metadata?.service, metadata?.identifier, returnType]);
const refetchData = useCallback(async ()=> { const refetchData = useCallback(async ()=> {
if(!metadata) throw new Error('usePublish is missing metadata') if(!metadata) throw new Error('usePublish is missing metadata')