diff --git a/qortal-ui-plugins/plugins/core/qdn/browser/browser.src.js b/qortal-ui-plugins/plugins/core/qdn/browser/browser.src.js index 8bb465b0..64bdb65b 100644 --- a/qortal-ui-plugins/plugins/core/qdn/browser/browser.src.js +++ b/qortal-ui-plugins/plugins/core/qdn/browser/browser.src.js @@ -297,7 +297,7 @@ class WebBrowser extends LitElement { const worker = new WebWorker(); console.log({worker}) try { - await publishData({ + const resPublish = await publishData({ registeredName: name, file: data64, service: service, @@ -308,7 +308,9 @@ class WebBrowser extends LitElement { worker: worker, isBase64: true, }); - + let data = {}; + data["data"] = resPublish; + response = JSON.stringify(data); worker.terminate(); } catch (error) { worker.terminate(); diff --git a/qortal-ui-plugins/plugins/utils/publish-image.js b/qortal-ui-plugins/plugins/utils/publish-image.js index 9f03644a..69f4861e 100644 --- a/qortal-ui-plugins/plugins/utils/publish-image.js +++ b/qortal-ui-plugins/plugins/utils/publish-image.js @@ -44,7 +44,7 @@ export const publishData = async ({ transactionBytesBase58 ) if (convertedBytesBase58.error) { - return + throw new Error('Error when signing'); } const convertedBytes = @@ -74,7 +74,7 @@ export const publishData = async ({ }) let myResponse = { error: "" } if (response === false) { - return + throw new Error('Error when signing'); } else { myResponse = response } @@ -85,21 +85,22 @@ export const publishData = async ({ const validate = async () => { let validNameRes = await validateName(registeredName) if (validNameRes.error) { - return + throw new Error('Name not found'); } let transactionBytes = await uploadData(registeredName, path, file) if (transactionBytes.error) { - return + throw new Error('Error when uploading'); } else if ( transactionBytes.includes("Error 500 Internal Server Error") ) { - return + throw new Error('Error when uploading'); } let signAndProcessRes = await signAndProcess(transactionBytes) if (signAndProcessRes.error) { - return + throw new Error('Error when signing'); } + return signAndProcessRes } const uploadData = async (registeredName, path, file) => {