mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 02:45:54 +01:00
fixed unloading the encrypted page after encryption timeout by simply reloading the app completely plus some unrelated refactorings
This commit is contained in:
@@ -11,7 +11,7 @@ const audit_category = require('../../services/audit_category');
|
||||
router.post('', auth.checkApiAuth, async (req, res, next) => {
|
||||
const treeLoadTime = req.body.treeLoadTime;
|
||||
const currentNoteId = req.body.currentNoteId;
|
||||
const currentNoteDateModified = req.body.currentNoteDateModified;
|
||||
const currentNoteLoadTime = req.body.currentNoteLoadTime;
|
||||
|
||||
const browserId = req.get('x-browser-id');
|
||||
|
||||
@@ -20,13 +20,13 @@ router.post('', auth.checkApiAuth, async (req, res, next) => {
|
||||
audit_category.UPDATE_TITLE, audit_category.CHANGE_PARENT, audit_category.CHANGE_POSITION]);
|
||||
|
||||
const currentNoteChangesCount = await sql.getSingleValue("SELECT COUNT(*) FROM audit_log WHERE (browser_id IS NULL OR browser_id != ?) " +
|
||||
"AND date_modified >= ? AND note_id = ? AND category IN (?)", [browserId, currentNoteDateModified, currentNoteId,
|
||||
"AND date_modified >= ? AND note_id = ? AND category IN (?)", [browserId, currentNoteLoadTime, currentNoteId,
|
||||
audit_category.UPDATE_CONTENT]);
|
||||
|
||||
if (currentNoteChangesCount > 0) {
|
||||
console.log("Current note changed!");
|
||||
console.log("SELECT COUNT(*) FROM audit_log WHERE (browser_id IS NULL OR browser_id != '" + browserId + "') " +
|
||||
"AND date_modified >= " + currentNoteDateModified + " AND note_id = '" + currentNoteId + "' AND category IN ('" + audit_category.UPDATE_CONTENT + "')");
|
||||
"AND date_modified >= " + currentNoteLoadTime + " AND note_id = '" + currentNoteId + "' AND category IN ('" + audit_category.UPDATE_CONTENT + "')");
|
||||
}
|
||||
|
||||
let changesToPushCount = 0;
|
||||
|
||||
Reference in New Issue
Block a user