From 58e7dee8a16a305d4b2f18fdd07082a0f9a1c4e5 Mon Sep 17 00:00:00 2001 From: CalDescent <> Date: Sat, 18 Mar 2023 18:16:07 +0000 Subject: [PATCH] Added optional "filename" parameter to `PUBLISH_QDN_RESOURCE` action. --- qortal-ui-plugins/plugins/core/qdn/browser/browser.src.js | 2 ++ qortal-ui-plugins/plugins/utils/publish-image.js | 5 +++++ 2 files changed, 7 insertions(+) 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 27c706ca..b5628f77 100644 --- a/qortal-ui-plugins/plugins/core/qdn/browser/browser.src.js +++ b/qortal-ui-plugins/plugins/core/qdn/browser/browser.src.js @@ -544,6 +544,7 @@ class WebBrowser extends LitElement { const name = data.name; let identifier = data.identifier; const data64 = data.data64; + const filename = data.filename; if (data.identifier == null) { identifier = 'default'; } @@ -564,6 +565,7 @@ class WebBrowser extends LitElement { selectedAddress: this.selectedAddress, worker: worker, isBase64: true, + filename: filename, apiVersion: 2, withFee: res2.userData.isWithFee === true ? true: false }); diff --git a/qortal-ui-plugins/plugins/utils/publish-image.js b/qortal-ui-plugins/plugins/utils/publish-image.js index 22484335..471bfc73 100644 --- a/qortal-ui-plugins/plugins/utils/publish-image.js +++ b/qortal-ui-plugins/plugins/utils/publish-image.js @@ -18,6 +18,7 @@ export const publishData = async ({ selectedAddress, worker, isBase64, + filename, metaData, apiVersion, withFee @@ -179,6 +180,10 @@ export const publishData = async ({ if(withFee){ uploadDataUrl = uploadDataUrl + '&fee=100000' } + + if(filename != null && filename != "undefined"){ + uploadDataUrl = uploadDataUrl + '&filename=' + encodeURIComponent(filename) + } let uploadDataRes = await parentEpml.request("apiCall", { type: "api",