mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
check the attachment after conversion
This commit is contained in:
parent
ff6f2a4d44
commit
cea54aecad
@ -124,9 +124,7 @@ class BAttachment extends AbstractBeccaEntity {
|
||||
this._setContent(content, opts);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {{note: BNote, branch: BBranch}}
|
||||
*/
|
||||
/** @returns {{note: BNote, branch: BBranch}} */
|
||||
convertToNote() {
|
||||
if (this.type === 'search') {
|
||||
throw new Error(`Note of type search cannot have child notes`);
|
||||
|
@ -1495,6 +1495,9 @@ class BNote extends AbstractBeccaEntity {
|
||||
|
||||
parentNote.setContent(fixedContent);
|
||||
|
||||
const noteService = require("../../services/notes");
|
||||
noteService.asyncPostProcessContent(parentNote, fixedContent);
|
||||
|
||||
this.deleteNote();
|
||||
|
||||
return attachment;
|
||||
|
@ -153,12 +153,12 @@ export default class AttachmentDetailWidget extends BasicWidget {
|
||||
$deletionWarning.show();
|
||||
|
||||
if (willBeDeletedInMs >= 60000) {
|
||||
$deletionWarning.text(`This attachment will be deleted in ${utils.formatTimeInterval(willBeDeletedInMs)}`);
|
||||
$deletionWarning.text(`This attachment will be automatically deleted in ${utils.formatTimeInterval(willBeDeletedInMs)}`);
|
||||
} else {
|
||||
$deletionWarning.text(`This attachment will be deleted soon`);
|
||||
$deletionWarning.text(`This attachment will be automatically deleted soon`);
|
||||
}
|
||||
|
||||
$deletionWarning.append(", because the attachment is not linked in the note's content. To prevent deletion, add the attachment link back into the content.");
|
||||
$deletionWarning.append(", because the attachment is not linked in the note's content. To prevent deletion, add the attachment link back into the content or convert the attachment into note.");
|
||||
} else {
|
||||
this.$wrapper.removeClass("scheduled-for-deletion");
|
||||
$deletionWarning.hide();
|
||||
@ -185,11 +185,11 @@ export default class AttachmentDetailWidget extends BasicWidget {
|
||||
});
|
||||
|
||||
utils.copyHtmlToClipboard($link[0].outerHTML);
|
||||
|
||||
toastService.showMessage("Attachment link copied to clipboard.");
|
||||
} else {
|
||||
throw new Error(`Unrecognized attachment role '${this.attachment.role}'.`);
|
||||
}
|
||||
|
||||
toastService.showMessage("Attachment link copied to clipboard.");
|
||||
}
|
||||
|
||||
async entitiesReloadedEvent({loadResults}) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user