mirror of
https://github.com/Qortal/chrome-extension.git
synced 2025-03-28 08:15:55 +00:00
fix bug encryption qortalrequest
This commit is contained in:
parent
f1e2192096
commit
d7a226e47c
@ -835,6 +835,7 @@ if (!window.hasAddedQortalListener) {
|
|||||||
event.ports[0]
|
event.ports[0]
|
||||||
);
|
);
|
||||||
} else if (event?.data?.action === 'PUBLISH_MULTIPLE_QDN_RESOURCES' || event?.data?.action === 'PUBLISH_QDN_RESOURCE' || event?.data?.action === 'ENCRYPT_DATA' || event?.data?.action === 'SAVE_FILE') {
|
} else if (event?.data?.action === 'PUBLISH_MULTIPLE_QDN_RESOURCES' || event?.data?.action === 'PUBLISH_QDN_RESOURCE' || event?.data?.action === 'ENCRYPT_DATA' || event?.data?.action === 'SAVE_FILE') {
|
||||||
|
console.log('event?.data?', event?.data)
|
||||||
let data;
|
let data;
|
||||||
try {
|
try {
|
||||||
data = await storeFilesInIndexedDB(event.data);
|
data = await storeFilesInIndexedDB(event.data);
|
||||||
|
@ -594,9 +594,15 @@ export const publishQDNResource = async (data: any, sender) => {
|
|||||||
}
|
}
|
||||||
if (data.encrypt) {
|
if (data.encrypt) {
|
||||||
try {
|
try {
|
||||||
|
const resKeyPair = await getKeyPair()
|
||||||
|
const parsedData = JSON.parse(resKeyPair)
|
||||||
|
const privateKey = parsedData.privateKey
|
||||||
|
const userPublicKey = parsedData.publicKey
|
||||||
const encryptDataResponse = encryptDataGroup({
|
const encryptDataResponse = encryptDataGroup({
|
||||||
data64,
|
data64,
|
||||||
publicKeys: data.publicKeys,
|
publicKeys: data.publicKeys,
|
||||||
|
privateKey,
|
||||||
|
userPublicKey
|
||||||
});
|
});
|
||||||
if (encryptDataResponse) {
|
if (encryptDataResponse) {
|
||||||
data64 = encryptDataResponse;
|
data64 = encryptDataResponse;
|
||||||
@ -810,9 +816,15 @@ export const publishMultipleQDNResources = async (data: any, sender) => {
|
|||||||
}
|
}
|
||||||
if (data.encrypt) {
|
if (data.encrypt) {
|
||||||
try {
|
try {
|
||||||
|
const resKeyPair = await getKeyPair()
|
||||||
|
const parsedData = JSON.parse(resKeyPair)
|
||||||
|
const privateKey = parsedData.privateKey
|
||||||
|
const userPublicKey = parsedData.publicKey
|
||||||
const encryptDataResponse = encryptDataGroup({
|
const encryptDataResponse = encryptDataGroup({
|
||||||
data64,
|
data64,
|
||||||
publicKeys: data.publicKeys,
|
publicKeys: data.publicKeys,
|
||||||
|
privateKey,
|
||||||
|
userPublicKey
|
||||||
});
|
});
|
||||||
if (encryptDataResponse) {
|
if (encryptDataResponse) {
|
||||||
data64 = encryptDataResponse;
|
data64 = encryptDataResponse;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user