Compare commits

...

7 Commits

Author SHA1 Message Date
zadam
5f20d033a8 release 0.45.1 2020-10-26 22:51:10 +01:00
zadam
93d0324177 fix case where parents of templates are not loaded
(cherry picked from commit a3f4fc7762)
2020-10-26 20:13:11 +01:00
zadam
0afd3c65aa fix setting note title on back/forward button click, closes #1334 2020-10-26 20:11:43 +01:00
zadam
8901c3ec91 fix recent changes showing deleted search note, closes #1331 2020-10-26 19:58:56 +01:00
zadam
c671b0a345 fix OPML import, closes #1333 2020-10-26 19:02:33 +01:00
zadam
9f424836e2 fix adding relation noteId as value, closes #1329 2020-10-26 16:05:34 +01:00
zadam
7f5af4b959 fix broken addTextToActiveEditor API method, closes #1332 2020-10-26 15:57:37 +01:00
9 changed files with 23 additions and 15 deletions

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "trilium",
"version": "0.44.9",
"version": "0.45.0-beta",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -2,7 +2,7 @@
"name": "trilium",
"productName": "Trilium Notes",
"description": "Trilium Notes",
"version": "0.45.0-beta",
"version": "0.45.1",
"license": "AGPL-3.0-only",
"main": "electron.js",
"bin": {

View File

@@ -115,13 +115,13 @@ export default class TabManager extends Component {
// using pushState instead of directly modifying document.location because it does not trigger hashchange
window.history.pushState(null, "", url);
}
document.title = "Trilium Notes";
document.title = "Trilium Notes";
if (activeTabContext.note) {
// it helps navigating in history if note title is included in the title
document.title += " - " + activeTabContext.note.title;
}
if (activeTabContext.note) {
// it helps navigating in history if note title is included in the title
document.title += " - " + activeTabContext.note.title;
}
this.triggerEvent('activeNoteChanged'); // trigger this even in on popstate event

View File

@@ -20,6 +20,9 @@ class TreeCache {
async loadInitialTree() {
const resp = await server.get('tree');
// FIXME: we need to do this to cover for ascendants of template notes which are not loaded
await this.loadParents(resp, false);
// clear the cache only directly before adding new content which is important for e.g. switching to protected session
/** @type {Object.<string, NoteShort>} */
@@ -40,6 +43,8 @@ class TreeCache {
async loadSubTree(subTreeNoteId) {
const resp = await server.get('tree?subTreeNoteId=' + subTreeNoteId);
await this.loadParents(resp, true);
this.addResp(resp);
return this.notes[subTreeNoteId];
@@ -191,8 +196,8 @@ class TreeCache {
if (note.type === 'search') {
const searchResultNoteIds = await server.get('search-note/' + note.noteId);
if (!searchResultNoteIds) {
throw new Error(`Search note ${note.noteId} failed.`);
if (!Array.isArray(searchResultNoteIds)) {
throw new Error(`Search note ${note.noteId} failed: ${searchResultNoteIds}`);
}
// force to load all the notes at once instead of one by one

View File

@@ -283,7 +283,9 @@ export default class AttributeDetailWidget extends TabAwareWidget {
return false;
}
this.attribute.value = suggestion.notePath;
const pathChunks = suggestion.notePath.split('/');
this.attribute.value = pathChunks[pathChunks.length - 1]; // noteId
this.triggerCommand('updateAttributeList', { attributes: this.allAttributes });
this.updateRelatedNotes();

View File

@@ -181,7 +181,7 @@ export default class EditableTextTypeWidget extends AbstractTextTypeWidget {
});
}
addTextToActiveEditorEvent(text) {
addTextToActiveEditorEvent({text}) {
if (!this.isActive()) {
return;
}

View File

@@ -38,7 +38,8 @@ async function searchFromNote(req) {
}
if (note.isDeleted) {
return [400, `Note ${req.params.noteId} is deleted.`];
// this can be triggered from recent changes and it's harmless to return empty list rather than fail
return [];
}
if (note.type !== 'search') {

View File

@@ -1 +1 @@
module.exports = { buildDate:"2020-10-21T22:57:54+02:00", buildRevision: "283808d69181628b84d7d48b5029c51bc5a1cf98" };
module.exports = { buildDate:"2020-10-26T22:51:10+01:00", buildRevision: "93d0324177a34cb79caf410ff7fc14a18c4f2633" };

View File

@@ -11,8 +11,8 @@ const htmlSanitizer = require('../html_sanitizer');
* @param {Note} parentNote
* @return {Promise<*[]|*>}
*/
function importOpml(taskContext, fileBuffer, parentNote) {
const xml = new Promise(function(resolve, reject)
async function importOpml(taskContext, fileBuffer, parentNote) {
const xml = await new Promise(function(resolve, reject)
{
parseString(fileBuffer, function (err, result) {
if (err) {