mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
Merge branch 'master' into next
This commit is contained in:
commit
43eb248450
@ -2,7 +2,7 @@
|
|||||||
"name": "trilium",
|
"name": "trilium",
|
||||||
"productName": "Trilium Notes",
|
"productName": "Trilium Notes",
|
||||||
"description": "Trilium Notes",
|
"description": "Trilium Notes",
|
||||||
"version": "0.47.1-beta",
|
"version": "0.47.2",
|
||||||
"license": "AGPL-3.0-only",
|
"license": "AGPL-3.0-only",
|
||||||
"main": "electron.js",
|
"main": "electron.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
@ -813,6 +813,7 @@ export default class NoteTreeWidget extends TabAwareWidget {
|
|||||||
const activeContext = appContext.tabManager.getActiveTabContext();
|
const activeContext = appContext.tabManager.getActiveTabContext();
|
||||||
|
|
||||||
if (activeContext && activeContext.notePath) {
|
if (activeContext && activeContext.notePath) {
|
||||||
|
this.tree.$container.focus();
|
||||||
this.tree.setFocus(true);
|
this.tree.setFocus(true);
|
||||||
|
|
||||||
const node = await this.expandToNote(activeContext.notePath);
|
const node = await this.expandToNote(activeContext.notePath);
|
||||||
|
@ -122,11 +122,12 @@ function BackendScriptApi(currentNote, apiParams) {
|
|||||||
* "#dateModified =* MONTH AND #log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
|
* "#dateModified =* MONTH AND #log". See full documentation for all options at: https://github.com/zadam/trilium/wiki/Search
|
||||||
*
|
*
|
||||||
* @method
|
* @method
|
||||||
* @param {string} searchString
|
* @param {string} query
|
||||||
|
* @param {Object} [searchParams]
|
||||||
* @returns {Note|null}
|
* @returns {Note|null}
|
||||||
*/
|
*/
|
||||||
this.searchForNote = searchString => {
|
this.searchForNote = (query, searchParams = {}) => {
|
||||||
const notes = searchService.searchNoteEntities(searchString);
|
const notes = this.searchForNotes(query, searchParams);
|
||||||
|
|
||||||
return notes.length > 0 ? notes[0] : null;
|
return notes.length > 0 ? notes[0] : null;
|
||||||
};
|
};
|
||||||
|
@ -1 +1 @@
|
|||||||
module.exports = { buildDate:"2021-04-19T22:43:03+02:00", buildRevision: "6136243d6117910b80feafad4fc7121ecc42d794" };
|
module.exports = { buildDate:"2021-04-26T22:32:54+02:00", buildRevision: "6f1b0b92fe8dcea736c15217c69512c7fee769cb" };
|
||||||
|
@ -80,7 +80,9 @@ function cleanupEntityChangesForMissingEntities(entityName, entityPrimaryKey) {
|
|||||||
function fillEntityChanges(entityName, entityPrimaryKey, condition = '') {
|
function fillEntityChanges(entityName, entityPrimaryKey, condition = '') {
|
||||||
try {
|
try {
|
||||||
cleanupEntityChangesForMissingEntities(entityName, entityPrimaryKey);
|
cleanupEntityChangesForMissingEntities(entityName, entityPrimaryKey);
|
||||||
|
const repository = require("./repository.js");
|
||||||
|
|
||||||
|
sql.transactional(() => {
|
||||||
const entityIds = sql.getColumn(`SELECT ${entityPrimaryKey} FROM ${entityName}`
|
const entityIds = sql.getColumn(`SELECT ${entityPrimaryKey} FROM ${entityName}`
|
||||||
+ (condition ? ` WHERE ${condition}` : ''));
|
+ (condition ? ` WHERE ${condition}` : ''));
|
||||||
|
|
||||||
@ -93,18 +95,22 @@ function fillEntityChanges(entityName, entityPrimaryKey, condition = '') {
|
|||||||
if (existingRows === 0) {
|
if (existingRows === 0) {
|
||||||
createdCount++;
|
createdCount++;
|
||||||
|
|
||||||
sql.insert("entity_changes", {
|
const entity = repository.getEntity(`SELECT * FROM ${entityName} WHERE ${entityPrimaryKey} = ?`, [entityId]);
|
||||||
entityName: entityName,
|
|
||||||
entityId: entityId,
|
addEntityChange({
|
||||||
sourceId: "SYNC_FILL",
|
entityName,
|
||||||
isSynced: 1
|
entityId,
|
||||||
});
|
hash: entity.generateHash(),
|
||||||
|
isErased: false,
|
||||||
|
utcDateChanged: entity.getUtcDateChanged()
|
||||||
|
}, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (createdCount > 0) {
|
if (createdCount > 0) {
|
||||||
log.info(`Created ${createdCount} missing entity changes for ${entityName}.`);
|
log.info(`Created ${createdCount} missing entity changes for ${entityName}.`);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
// this is to fix migration from 0.30 to 0.32, can be removed later
|
// this is to fix migration from 0.30 to 0.32, can be removed later
|
||||||
|
Loading…
x
Reference in New Issue
Block a user