mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-02-11 17:55:51 +00:00
fixes
This commit is contained in:
parent
6169da48a8
commit
bf03a1764d
@ -1226,14 +1226,14 @@
|
||||
"profile5": "Bio",
|
||||
"profile6": "Wallet Addresses",
|
||||
"profile7": "Fill from UI",
|
||||
"profile8": "Add custom data",
|
||||
"profile8": "Add custom property",
|
||||
"profile9": "Property name",
|
||||
"profile10": "Fields",
|
||||
"profile11": "Add new field",
|
||||
"profile12": "Field name",
|
||||
"profile13": "Fill out",
|
||||
"profile14": "Activity",
|
||||
"profile15": "No data",
|
||||
"profile15": "No value",
|
||||
"profile16": "This name has no profile",
|
||||
"profile17": "Unable to fetch profile",
|
||||
"profile18": "Open profile",
|
||||
|
@ -326,6 +326,7 @@ class ProfileQdn extends connect(store)(LitElement) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
async setValues(response, resource) {
|
||||
if (response) {
|
||||
let data = { ...response };
|
||||
@ -336,7 +337,6 @@ class ProfileQdn extends connect(store)(LitElement) {
|
||||
const decryptedData = decryptGroupData(
|
||||
data.customData[key]
|
||||
);
|
||||
|
||||
if (decryptedData && !decryptedData.error) {
|
||||
const decryptedDataToBase64 =
|
||||
uint8ArrayToObject(decryptedData);
|
||||
@ -541,18 +541,31 @@ class ProfileQdn extends connect(store)(LitElement) {
|
||||
const getArbitraryFee = await this.getArbitraryFee();
|
||||
const feeAmount = getArbitraryFee.fee;
|
||||
|
||||
let newObject = { ...data };
|
||||
let newObject = structuredClone(data)
|
||||
|
||||
for (const key of Object.keys(newObject.customData || {})) {
|
||||
if (key.includes('-private')) {
|
||||
const toBase64 = await objectToBase64(
|
||||
newObject.customData[key]
|
||||
);
|
||||
const encryptedData = encryptDataGroup({
|
||||
data64: toBase64,
|
||||
publicKeys: [],
|
||||
});
|
||||
newObject['customData'][key] = encryptedData;
|
||||
const dataKey = newObject.customData[key]
|
||||
let isBase64 = false
|
||||
try {
|
||||
const decodedString = atob(dataKey);
|
||||
isBase64 = decodedString.includes('qortalGroupEncryptedData')
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
if(isBase64){
|
||||
newObject['customData'][key] = newObject.customData[key];
|
||||
} else {
|
||||
const toBase64 = await objectToBase64(
|
||||
newObject.customData[key]
|
||||
);
|
||||
const encryptedData = encryptDataGroup({
|
||||
data64: toBase64,
|
||||
publicKeys: [],
|
||||
});
|
||||
newObject['customData'][key] = encryptedData;
|
||||
}
|
||||
|
||||
} else {
|
||||
newObject['customData'][key] = newObject.customData[key];
|
||||
}
|
||||
|
@ -2206,11 +2206,12 @@ class WebBrowser extends LitElement {
|
||||
// Set up an event listener to wait for the response
|
||||
window.addEventListener('qortal-request-set-profile-data-response', handleResponseEvent);
|
||||
});
|
||||
if(!res.response) throw new Error('Failed to set property')
|
||||
response = JSON.stringify(res.response);
|
||||
|
||||
response = JSON.stringify(res);
|
||||
} catch (error) {
|
||||
const obj = {};
|
||||
const errorMsg = error.message || 'Failed to join the group.';
|
||||
const errorMsg = error.message || 'Failed to set property.';
|
||||
obj['error'] = errorMsg;
|
||||
response = JSON.stringify(obj);
|
||||
} finally {
|
||||
@ -3792,7 +3793,7 @@ async function showModalAndWait(type, data) {
|
||||
` : ''}
|
||||
${type === actions.SET_PROFILE_DATA ? `
|
||||
<div class="modal-subcontainer">
|
||||
<p class="modal-paragraph">${get("browserpage.bchange50")}: <span style="font-weight: bold"> ${data.property}</span></p>
|
||||
<p class="modal-paragraph">${get("browserpage.bchange50")} <span style="font-weight: bold"> ${data.property}</span></p>
|
||||
<br>
|
||||
<p style="font-size: 16px;overflow-wrap: anywhere;" class="modal-paragraph">${get('browserpage.bchange47')} <span style="font-weight: bold">${data.fee} QORT fee</span></p>
|
||||
<br>
|
||||
|
Loading…
x
Reference in New Issue
Block a user