fix content renderer of protected canvas/mermaid notes, closes #4414

This commit is contained in:
zadam 2023-11-12 23:43:04 +01:00
parent 4bdb40904f
commit 5a38bf78e1
2 changed files with 4 additions and 16 deletions

View File

@ -1156,14 +1156,8 @@ class BNote extends AbstractBeccaEntity {
/** @returns {BAttachment} */
getAttachmentByTitle(title) {
return sql.getRows(`
SELECT attachments.*
FROM attachments
WHERE ownerId = ?
AND title = ?
AND isDeleted = 0
ORDER BY position`, [this.noteId, title])
.map(row => new BAttachment(row))[0];
// cannot use SQL to filter by title since it can be encrypted
return this.getAttachments().filter(attachment => attachment.title === title)[0];
}
/**

View File

@ -157,14 +157,8 @@ class BRevision extends AbstractBeccaEntity {
/** @returns {BAttachment} */
getAttachmentByTitle(title) {
return sql.getRows(`
SELECT attachments.*
FROM attachments
WHERE ownerId = ?
AND title = ?
AND isDeleted = 0
ORDER BY position`, [this.revisionId, title])
.map(row => new BAttachment(row))[0];
// cannot use SQL to filter by title since it can be encrypted
return this.getAttachments().filter(attachment => attachment.title === title)[0];
}
beforeSaving() {