chore(code): fix editorconfig for src/public

This commit is contained in:
Elian Doran
2024-12-22 15:42:15 +02:00
parent ae90ff2df4
commit b321d99076
70 changed files with 589 additions and 590 deletions

View File

@@ -490,7 +490,7 @@ async function downloadImage(noteId: string, imageUrl: string) {
const title = path.basename(parsedUrl.pathname || "");
const attachment = imageService.saveImageToAttachment(noteId, imageBuffer, title, true, true);
if (attachment.attachmentId) {
imageUrlToAttachmentIdMapping[imageUrl] = attachment.attachmentId;
} else {
@@ -810,11 +810,11 @@ function undeleteBranch(branchId: string, deleteId: string, taskContext: TaskCon
noteEntity.save();
const attributeRows = sql.getRows<AttributeRow>(`
SELECT * FROM attributes
WHERE isDeleted = 1
AND deleteId = ?
AND (noteId = ?
OR (type = 'relation' AND value = ?))`, [deleteId, noteRow.noteId, noteRow.noteId]);
SELECT * FROM attributes
WHERE isDeleted = 1
AND deleteId = ?
AND (noteId = ?
OR (type = 'relation' AND value = ?))`, [deleteId, noteRow.noteId, noteRow.noteId]);
for (const attributeRow of attributeRows) {
// relation might point to a note which hasn't been undeleted yet and would thus throw up
@@ -824,8 +824,8 @@ function undeleteBranch(branchId: string, deleteId: string, taskContext: TaskCon
const attachmentRows = sql.getRows<AttachmentRow>(`
SELECT * FROM attachments
WHERE isDeleted = 1
AND deleteId = ?
AND ownerId = ?`, [deleteId, noteRow.noteId]);
AND deleteId = ?
AND ownerId = ?`, [deleteId, noteRow.noteId]);
for (const attachmentRow of attachmentRows) {
new BAttachment(attachmentRow).save();
@@ -835,8 +835,8 @@ function undeleteBranch(branchId: string, deleteId: string, taskContext: TaskCon
SELECT branches.branchId
FROM branches
WHERE branches.isDeleted = 1
AND branches.deleteId = ?
AND branches.parentNoteId = ?`, [deleteId, noteRow.noteId]);
AND branches.deleteId = ?
AND branches.parentNoteId = ?`, [deleteId, noteRow.noteId]);
for (const childBranchId of childBranchIds) {
undeleteBranch(childBranchId, deleteId, taskContext);
@@ -853,9 +853,9 @@ function getUndeletedParentBranchIds(noteId: string, deleteId: string) {
FROM branches
JOIN notes AS parentNote ON parentNote.noteId = branches.parentNoteId
WHERE branches.noteId = ?
AND branches.isDeleted = 1
AND branches.deleteId = ?
AND parentNote.isDeleted = 0`, [noteId, deleteId]);
AND branches.isDeleted = 1
AND branches.deleteId = ?
AND parentNote.isDeleted = 0`, [noteId, deleteId]);
}
function scanForLinks(note: BNote, content: string | Buffer) {
@@ -941,7 +941,7 @@ function duplicateSubtreeWithoutRoot(origNoteId: string, newNoteId: string) {
if (origNote == null) {
throw new Error("Unable to find note to duplicate.");
}
const noteIdMapping = getNoteIdMapping(origNote);
for (const childBranch of origNote.getChildBranches()) {
if (childBranch) {