mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-06-06 18:31:00 +00:00
Update src/components/forms/document/EditPublishedDocumentForm.js
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
parent
eaa2b77e06
commit
b683089934
@ -81,11 +81,17 @@ const EditPublishedDocumentForm = ({ event }) => {
|
|||||||
// Encrypt content if it's a paid resource
|
// Encrypt content if it's a paid resource
|
||||||
let finalContent = content;
|
let finalContent = content;
|
||||||
if (isPaidResource && price > 0) {
|
if (isPaidResource && price > 0) {
|
||||||
|
try {
|
||||||
finalContent = await encryptContent(content);
|
finalContent = await encryptContent(content);
|
||||||
if (!finalContent) {
|
if (!finalContent) {
|
||||||
showToast('error', 'Error', 'Failed to encrypt content');
|
showToast('error', 'Error', 'Failed to encrypt content');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Encryption error:', error);
|
||||||
|
showToast('error', 'Error', 'Failed to encrypt content: ' + error.message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const ndkEvent = new NDKEvent(ndk);
|
const ndkEvent = new NDKEvent(ndk);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user