fix updating non-text notes

This commit is contained in:
zadam
2023-05-07 11:20:51 +02:00
parent 371f174756
commit 4d5612e845
2 changed files with 9 additions and 9 deletions

View File

@@ -575,12 +575,12 @@ function downloadImages(noteId, content) {
}
function saveLinks(note, content) {
if (note.type !== 'text' && note.type !== 'relationMap') {
return content;
}
if (note.isProtected && !protectedSessionService.isProtectedSessionAvailable()) {
return content;
if ((note.type !== 'text' && note.type !== 'relationMap')
|| (note.isProtected && !protectedSessionService.isProtectedSessionAvailable())) {
return {
forceFrontendReload: false,
content
};
}
const foundLinks = [];
@@ -599,7 +599,7 @@ function saveLinks(note, content) {
findRelationMapLinks(content, foundLinks);
}
else {
throw new Error(`Unrecognized type ${note.type}`);
throw new Error(`Unrecognized type '${note.type}'`);
}
const existingLinks = note.getRelations().filter(rel =>