mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fixing consistency checks
This commit is contained in:
parent
f24ea8137b
commit
151687cd9b
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
const optionService = require('../../services/options');
|
const optionService = require('../../services/options');
|
||||||
const log = require('../../services/log');
|
const log = require('../../services/log');
|
||||||
const attributes = require('../../services/attributes');
|
|
||||||
const searchService = require('../../services/search/services/search');
|
const searchService = require('../../services/search/services/search');
|
||||||
|
|
||||||
// options allowed to be updated directly in options dialog
|
// options allowed to be updated directly in options dialog
|
||||||
|
@ -469,26 +469,17 @@ class ConsistencyChecks {
|
|||||||
WHERE
|
WHERE
|
||||||
entity_changes.id IS NULL`,
|
entity_changes.id IS NULL`,
|
||||||
({entityId}) => {
|
({entityId}) => {
|
||||||
|
const entity = sql.getRow(`SELECT * FROM ${entityName} WHERE ${key} = ?`, [entityId]);
|
||||||
|
|
||||||
if (this.autoFix) {
|
if (this.autoFix) {
|
||||||
if (entityName === 'note_contents' || entityName === 'note_revision_contents') {
|
entityChangesService.addEntityChange({
|
||||||
const entity = entityName === 'note_contents'
|
entityName,
|
||||||
? becca.getNote(entityId)
|
entityId,
|
||||||
: becca.getNoteRevision(entityId);
|
hash: utils.randomString(10), // doesn't matter, will force sync but that's OK
|
||||||
|
isErased: !!entity.isErased,
|
||||||
entity.setContent(entity.getContent(), true);
|
utcDateChanged: entity.utcDateModified || entity.utcDateCreated,
|
||||||
}
|
isSynced: entityName !== 'options' || entity.isSynced
|
||||||
else {
|
});
|
||||||
const entity = becca.getEntity(entityName, entityId);
|
|
||||||
|
|
||||||
entityChangesService.addEntityChange({
|
|
||||||
entityName,
|
|
||||||
entityId,
|
|
||||||
hash: entity.generateHash(),
|
|
||||||
isErased: false,
|
|
||||||
utcDateChanged: entity.getUtcDateChanged(),
|
|
||||||
isSynced: entityName !== 'options' || entity.isSynced
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
logFix(`Created missing entity change for entityName=${entityName}, entityId=${entityId}`);
|
logFix(`Created missing entity change for entityName=${entityName}, entityId=${entityId}`);
|
||||||
} else {
|
} else {
|
||||||
|
@ -52,11 +52,6 @@ async function createMainWindow() {
|
|||||||
|
|
||||||
const {BrowserWindow} = require('electron'); // should not be statically imported
|
const {BrowserWindow} = require('electron'); // should not be statically imported
|
||||||
|
|
||||||
const nativeImage = require('electron').nativeImage
|
|
||||||
|
|
||||||
const image = nativeImage.createFromPath(getIcon())
|
|
||||||
console.log(image)
|
|
||||||
|
|
||||||
mainWindow = new BrowserWindow({
|
mainWindow = new BrowserWindow({
|
||||||
x: mainWindowState.x,
|
x: mainWindowState.x,
|
||||||
y: mainWindowState.y,
|
y: mainWindowState.y,
|
||||||
@ -70,7 +65,7 @@ async function createMainWindow() {
|
|||||||
spellcheck: spellcheckEnabled
|
spellcheck: spellcheckEnabled
|
||||||
},
|
},
|
||||||
frame: optionService.getOptionBool('nativeTitleBarVisible'),
|
frame: optionService.getOptionBool('nativeTitleBarVisible'),
|
||||||
icon: image
|
icon: getIcon()
|
||||||
});
|
});
|
||||||
|
|
||||||
mainWindowState.manage(mainWindow);
|
mainWindowState.manage(mainWindow);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user