This commit is contained in:
PhilReact 2025-04-22 17:15:06 +03:00
parent 386906f262
commit 9663ab2459
4 changed files with 11 additions and 12 deletions

View File

@ -1,6 +1,6 @@
{
"name": "qapp-core",
"version": "1.0.21",
"version": "1.0.22",
"description": "Qortal's core React library with global state, UI components, and utilities",
"main": "dist/index.js",
"module": "dist/index.mjs",

View File

@ -84,8 +84,7 @@ export const IndexManager = ({ username }: PropsIndexManager) => {
name: name,
service: "METADATA",
identifier,
},
"JSON"
}
);
if (

View File

@ -71,7 +71,7 @@ export const usePublish = (
async (
metadataProp: QortalGetMetadata,
) => {
let resourceExists = null;
let hasResource = null;
let resource = null;
let error = null;
try {
@ -90,7 +90,7 @@ export const usePublish = (
return {
resource: null,
error: null,
resourceExists: false
hasResource: false
}
}
if(metadata){
@ -100,7 +100,7 @@ export const usePublish = (
return {
resource: hasCache,
error: null,
resourceExists: true
hasResource: true
}
}
const url = `/arbitrary/resources/search?mode=ALL&service=${metadataProp?.service}&limit=1&includemetadata=true&reverse=true&excludeblocked=true&name=${encodeURIComponent(metadataProp?.name)}&exactmatchnames=true&offset=0&identifier=${encodeURIComponent(metadataProp?.identifier)}`;
@ -115,24 +115,24 @@ export const usePublish = (
setError("Invalid search params");
}
return {
resourceExists,
hasResource,
resource,
error: "Invalid search params",
};
}
const resMetadata = await responseMetadata.json();
if (resMetadata?.length === 0) {
resourceExists = false;
hasResource = false;
if (metadata) {
setHasResource(false);
}
} else if (resMetadata[0]?.size === 32) {
resourceExists = false;
hasResource = false;
if (metadata) {
setHasResource(false);
}
} else {
resourceExists = true;
hasResource = true;
if (metadata) {
setHasResource(true);
}
@ -166,7 +166,7 @@ export const usePublish = (
}
}
return {
resourceExists,
hasResource,
resource,
error,
};

View File

@ -23,7 +23,7 @@ export {QortalSearchParams, QortalMetadata} from './types/interfaces/resources'
export {ImagePicker} from './common/ImagePicker'
export {useNameSearch} from './hooks/useNameSearch'
export {Resource} from './hooks/useResources'
export {Service} from './types/interfaces/resources'
export {Service, QortalGetMetadata} from './types/interfaces/resources'
export {ListItem} from './state/cache'
export {SymmetricKeys} from './utils/encryption'