Browse Source

Added optional "filename" parameter to `PUBLISH_QDN_RESOURCE` action.

q-apps
CalDescent 2 years ago
parent
commit
58e7dee8a1
  1. 2
      qortal-ui-plugins/plugins/core/qdn/browser/browser.src.js
  2. 5
      qortal-ui-plugins/plugins/utils/publish-image.js

2
qortal-ui-plugins/plugins/core/qdn/browser/browser.src.js

@ -544,6 +544,7 @@ class WebBrowser extends LitElement {
const name = data.name; const name = data.name;
let identifier = data.identifier; let identifier = data.identifier;
const data64 = data.data64; const data64 = data.data64;
const filename = data.filename;
if (data.identifier == null) { if (data.identifier == null) {
identifier = 'default'; identifier = 'default';
} }
@ -564,6 +565,7 @@ class WebBrowser extends LitElement {
selectedAddress: this.selectedAddress, selectedAddress: this.selectedAddress,
worker: worker, worker: worker,
isBase64: true, isBase64: true,
filename: filename,
apiVersion: 2, apiVersion: 2,
withFee: res2.userData.isWithFee === true ? true: false withFee: res2.userData.isWithFee === true ? true: false
}); });

5
qortal-ui-plugins/plugins/utils/publish-image.js

@ -18,6 +18,7 @@ export const publishData = async ({
selectedAddress, selectedAddress,
worker, worker,
isBase64, isBase64,
filename,
metaData, metaData,
apiVersion, apiVersion,
withFee withFee
@ -179,6 +180,10 @@ export const publishData = async ({
if(withFee){ if(withFee){
uploadDataUrl = uploadDataUrl + '&fee=100000' uploadDataUrl = uploadDataUrl + '&fee=100000'
} }
if(filename != null && filename != "undefined"){
uploadDataUrl = uploadDataUrl + '&filename=' + encodeURIComponent(filename)
}
let uploadDataRes = await parentEpml.request("apiCall", { let uploadDataRes = await parentEpml.request("apiCall", {
type: "api", type: "api",

Loading…
Cancel
Save