mirror of
https://github.com/TriliumNext/Notes.git
synced 2026-01-06 04:50:03 -06:00
chore(code): fix more js & ts files
This commit is contained in:
@@ -93,4 +93,4 @@ export default class Shaca {
|
||||
|
||||
return (this as any)[camelCaseEntityName][entityId];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ function load() {
|
||||
SELECT ?
|
||||
UNION
|
||||
SELECT branches.noteId FROM branches
|
||||
JOIN tree ON branches.parentNoteId = tree.noteId
|
||||
JOIN tree ON branches.parentNoteId = tree.noteId
|
||||
WHERE branches.isDeleted = 0
|
||||
)
|
||||
SELECT noteId FROM tree`, [shareRoot.SHARE_ROOT_NOTE_ID]);
|
||||
@@ -38,19 +38,19 @@ function load() {
|
||||
|
||||
const rawNoteRows = sql.getRawRows<SNoteRow>(`
|
||||
SELECT noteId, title, type, mime, blobId, utcDateModified, isProtected
|
||||
FROM notes
|
||||
WHERE isDeleted = 0
|
||||
AND noteId IN (${noteIdStr})`);
|
||||
FROM notes
|
||||
WHERE isDeleted = 0
|
||||
AND noteId IN (${noteIdStr})`);
|
||||
|
||||
for (const row of rawNoteRows) {
|
||||
new SNote(row);
|
||||
}
|
||||
|
||||
const rawBranchRows = sql.getRawRows<SBranchRow>(`
|
||||
SELECT branchId, noteId, parentNoteId, prefix, isExpanded, utcDateModified
|
||||
FROM branches
|
||||
WHERE isDeleted = 0
|
||||
AND parentNoteId IN (${noteIdStr})
|
||||
SELECT branchId, noteId, parentNoteId, prefix, isExpanded, utcDateModified
|
||||
FROM branches
|
||||
WHERE isDeleted = 0
|
||||
AND parentNoteId IN (${noteIdStr})
|
||||
ORDER BY notePosition`);
|
||||
|
||||
for (const row of rawBranchRows) {
|
||||
@@ -58,20 +58,20 @@ function load() {
|
||||
}
|
||||
|
||||
const rawAttributeRows = sql.getRawRows<SAttributeRow>(`
|
||||
SELECT attributeId, noteId, type, name, value, isInheritable, position, utcDateModified
|
||||
FROM attributes
|
||||
WHERE isDeleted = 0
|
||||
AND noteId IN (${noteIdStr})`);
|
||||
SELECT attributeId, noteId, type, name, value, isInheritable, position, utcDateModified
|
||||
FROM attributes
|
||||
WHERE isDeleted = 0
|
||||
AND noteId IN (${noteIdStr})`);
|
||||
|
||||
for (const row of rawAttributeRows) {
|
||||
new SAttribute(row);
|
||||
}
|
||||
|
||||
const rawAttachmentRows = sql.getRawRows<SAttachmentRow>(`
|
||||
SELECT attachmentId, ownerId, role, mime, title, blobId, utcDateModified
|
||||
FROM attachments
|
||||
WHERE isDeleted = 0
|
||||
AND ownerId IN (${noteIdStr})`);
|
||||
SELECT attachmentId, ownerId, role, mime, title, blobId, utcDateModified
|
||||
FROM attachments
|
||||
WHERE isDeleted = 0
|
||||
AND ownerId IN (${noteIdStr})`);
|
||||
|
||||
for (const row of rawAttachmentRows) {
|
||||
new SAttachment(row);
|
||||
|
||||
@@ -8,7 +8,7 @@ let dbConnection!: Database.Database;
|
||||
|
||||
sql_init.dbReady.then(() => {
|
||||
dbConnection = new Database(dataDir.DOCUMENT_PATH, { readonly: true });
|
||||
|
||||
|
||||
[`exit`, `SIGINT`, `SIGUSR1`, `SIGUSR2`, `SIGTERM`].forEach(eventType => {
|
||||
process.on(eventType, () => {
|
||||
if (dbConnection) {
|
||||
|
||||
Reference in New Issue
Block a user