mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 19:05:59 +01:00
Compare commits
9 Commits
v0.32.2-be
...
v0.32.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ebd26f85bd | ||
|
|
fbfb7b3b30 | ||
|
|
5b14358620 | ||
|
|
c4669cbaa3 | ||
|
|
74b41c9911 | ||
|
|
d08a36174d | ||
|
|
237749e4af | ||
|
|
15f4782947 | ||
|
|
d48efd1925 |
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "trilium",
|
||||
"version": "0.32.1-beta",
|
||||
"version": "0.32.2-beta",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "trilium",
|
||||
"productName": "Trilium Notes",
|
||||
"description": "Trilium Notes",
|
||||
"version": "0.32.2-beta",
|
||||
"version": "0.32.3",
|
||||
"license": "AGPL-3.0-only",
|
||||
"main": "electron.js",
|
||||
"bin": {
|
||||
|
||||
@@ -232,6 +232,12 @@ async function loadNoteDetail(origNotePath, options = {}) {
|
||||
|
||||
if (!notePath) {
|
||||
console.error(`Cannot resolve note path ${origNotePath}`);
|
||||
|
||||
// fallback to display something
|
||||
if (tabContexts.length === 0) {
|
||||
await openEmptyTab();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -337,10 +343,18 @@ function fireDetailLoaded() {
|
||||
}
|
||||
|
||||
messagingService.subscribeToSyncMessages(syncData => {
|
||||
for (const sync of syncData) {
|
||||
if (sync.entityName === 'notes') {
|
||||
refreshTabs(null, sync.entityId);
|
||||
}
|
||||
const noteIdsToRefresh = new Set();
|
||||
|
||||
syncData
|
||||
.filter(sync => sync.entityName === 'notes')
|
||||
.forEach(sync => noteIdsToRefresh.add(sync.entityId));
|
||||
|
||||
syncData
|
||||
.filter(sync => sync.entityName === 'attributes')
|
||||
.forEach(sync => noteIdsToRefresh.add(sync.noteId));
|
||||
|
||||
for (const noteId of noteIdsToRefresh) {
|
||||
refreshTabs(null, noteId);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -109,6 +109,8 @@ async function getNodeFromPath(notePath, expand = false, expandOpts = {}) {
|
||||
|
||||
// we expand only after hoisted note since before then nodes are not actually present in the tree
|
||||
if (parentNode) {
|
||||
checkFolderStatus(parentNode);
|
||||
|
||||
if (!parentNode.isLoaded()) {
|
||||
await parentNode.load();
|
||||
}
|
||||
@@ -369,8 +371,6 @@ async function treeInitialized() {
|
||||
setFrontendAsLoaded();
|
||||
}
|
||||
|
||||
let ignoreNextActivationNoteId = null;
|
||||
|
||||
function initFancyTree(tree) {
|
||||
utils.assertArguments(tree);
|
||||
|
||||
@@ -402,26 +402,11 @@ function initFancyTree(tree) {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
beforeActivate: (event, data) => {
|
||||
// this is for the case when tree reload has been called and we don't want to
|
||||
if (ignoreNextActivationNoteId && getActiveNode() !== null) {
|
||||
ignoreNextActivationNoteId = null;
|
||||
return false;
|
||||
}
|
||||
},
|
||||
activate: async (event, data) => {
|
||||
const node = data.node;
|
||||
const noteId = node.data.noteId;
|
||||
|
||||
if (ignoreNextActivationNoteId === noteId) {
|
||||
ignoreNextActivationNoteId = null;
|
||||
return;
|
||||
}
|
||||
|
||||
// click event won't propagate so let's close context menu manually
|
||||
contextMenuWidget.hideContextMenu();
|
||||
|
||||
const notePath = await treeUtils.getNotePath(node);
|
||||
const notePath = await treeUtils.getNotePath(data.node);
|
||||
|
||||
noteDetailService.switchToNote(notePath);
|
||||
},
|
||||
@@ -495,14 +480,16 @@ function getTree() {
|
||||
async function reload() {
|
||||
const notes = await loadTree();
|
||||
|
||||
// make sure the reload won't trigger reactivation. This is important especially in cases where we wait for the reload
|
||||
// to finish to then activate some other note. But since the activate() event is called asynchronously, it may be called
|
||||
// (or finished calling) after we switched to a different note.
|
||||
if (getActiveNode()) {
|
||||
ignoreNextActivationNoteId = getActiveNode().data.noteId;
|
||||
}
|
||||
const activeNotePath = getActiveNode() !== null ? await treeUtils.getNotePath(getActiveNode()) : null;
|
||||
|
||||
await getTree().reload(notes);
|
||||
|
||||
// reactivate originally activated node, but don't trigger note loading
|
||||
if (activeNotePath) {
|
||||
const node = await getNodeFromPath(activeNotePath, true);
|
||||
|
||||
await node.setActive(true, {noEvents: true});
|
||||
}
|
||||
}
|
||||
|
||||
function isNotePathInAddress() {
|
||||
@@ -546,7 +533,7 @@ async function collapseTree(node = null) {
|
||||
async function scrollToActiveNote() {
|
||||
const activeContext = noteDetailService.getActiveTabContext();
|
||||
|
||||
if (activeContext) {
|
||||
if (activeContext && activeContext.notePath) {
|
||||
const node = await expandToNote(activeContext.notePath);
|
||||
|
||||
node.makeVisible({scrollIntoView: true});
|
||||
|
||||
@@ -172,11 +172,11 @@ function register(app) {
|
||||
apiRoute(POST, '/api/password/change', passwordApiRoute.changePassword);
|
||||
|
||||
apiRoute(POST, '/api/sync/test', syncApiRoute.testSync);
|
||||
apiRoute(GET, '/api/sync/check', syncApiRoute.checkSync);
|
||||
apiRoute(POST, '/api/sync/now', syncApiRoute.syncNow);
|
||||
apiRoute(POST, '/api/sync/fill-sync-rows', syncApiRoute.fillSyncRows);
|
||||
apiRoute(POST, '/api/sync/force-full-sync', syncApiRoute.forceFullSync);
|
||||
apiRoute(POST, '/api/sync/force-note-sync/:noteId', syncApiRoute.forceNoteSync);
|
||||
route(GET, '/api/sync/check', [auth.checkApiAuth], syncApiRoute.checkSync, apiResultHandler);
|
||||
route(GET, '/api/sync/changed', [auth.checkApiAuth], syncApiRoute.getChanged, apiResultHandler);
|
||||
route(PUT, '/api/sync/update', [auth.checkApiAuth], syncApiRoute.update, apiResultHandler);
|
||||
route(POST, '/api/sync/finished', [auth.checkApiAuth], syncApiRoute.syncFinished, apiResultHandler);
|
||||
|
||||
@@ -1 +1 @@
|
||||
module.exports = { buildDate:"2019-05-29T23:14:59+02:00", buildRevision: "0a0cac5f41df0b867d0644fa392abb7a0ad4507a" };
|
||||
module.exports = { buildDate:"2019-06-02T14:04:32+02:00", buildRevision: "fbfb7b3b306d48ba9e7c09b7218af7354c58a3d1" };
|
||||
|
||||
@@ -65,6 +65,13 @@ async function sendMessageToAllClients(message) {
|
||||
|
||||
async function sendPing(client, lastSentSyncId) {
|
||||
const syncData = await sql.getRows("SELECT * FROM sync WHERE id > ?", [lastSentSyncId]);
|
||||
|
||||
for (const sync of syncData) {
|
||||
if (sync.entityName === 'attributes') {
|
||||
sync.noteId = await sql.getValue(`SELECT noteId FROM attributes WHERE attributeId = ?`, [sync.entityId]);
|
||||
}
|
||||
}
|
||||
|
||||
const stats = require('./sync').stats;
|
||||
|
||||
await sendMessage(client, {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
|
||||
<div id="recent-changes-dialog" class="modal fade mx-auto" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-dialog modal-dialog-scrollable" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Recent changes</h5>
|
||||
|
||||
Reference in New Issue
Block a user