mirror of
https://github.com/AustinKelsay/plebdevs.git
synced 2025-04-19 10:51:20 +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,9 +81,15 @@ const EditPublishedDocumentForm = ({ event }) => {
|
||||
// Encrypt content if it's a paid resource
|
||||
let finalContent = content;
|
||||
if (isPaidResource && price > 0) {
|
||||
finalContent = await encryptContent(content);
|
||||
if (!finalContent) {
|
||||
showToast('error', 'Error', 'Failed to encrypt content');
|
||||
try {
|
||||
finalContent = await encryptContent(content);
|
||||
if (!finalContent) {
|
||||
showToast('error', 'Error', 'Failed to encrypt content');
|
||||
return;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Encryption error:', error);
|
||||
showToast('error', 'Error', 'Failed to encrypt content: ' + error.message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user