mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
make sure the attribute is not duplicated in TreeCache and NoteCache, #1278
This commit is contained in:
parent
d163289003
commit
cba9b92202
@ -373,6 +373,7 @@ class Note extends Entity {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: this code is quite questionable, one problem is that other caches (TreeCache, NoteCache) have nothing like that
|
||||||
if (attr.isDefinition()) {
|
if (attr.isDefinition()) {
|
||||||
const firstDefinitionIndex = attributes.findIndex(el => el.type === attr.type && el.name === attr.name);
|
const firstDefinitionIndex = attributes.findIndex(el => el.type === attr.type && el.name === attr.name);
|
||||||
|
|
||||||
|
@ -205,7 +205,16 @@ class NoteShort {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
noteAttributeCache.attributes[this.noteId] = attrArrs.flat();
|
noteAttributeCache.attributes[this.noteId] = [];
|
||||||
|
const addedAttributeIds = new Set();
|
||||||
|
|
||||||
|
for (const attr of attrArrs.flat()) {
|
||||||
|
if (!addedAttributeIds.has(attr.attributeId)) {
|
||||||
|
addedAttributeIds.add(attr.attributeId);
|
||||||
|
|
||||||
|
noteAttributeCache.attributes[this.noteId].push(attr);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return noteAttributeCache.attributes[this.noteId];
|
return noteAttributeCache.attributes[this.noteId];
|
||||||
|
@ -852,7 +852,10 @@ ul.fancytree-container li {
|
|||||||
contain: layout paint;
|
contain: layout paint;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** ckeditor's autocomplete */
|
/**
|
||||||
|
ckeditor's autocomplete
|
||||||
|
should be higher than 1070 of tooltip
|
||||||
|
*/
|
||||||
.ck.ck-balloon-panel {
|
.ck.ck-balloon-panel {
|
||||||
z-index: 1001;
|
z-index: 1101;
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,18 @@ class Note {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.attributeCache = parentAttributes.concat(templateAttributes);
|
this.attributeCache = [];
|
||||||
|
|
||||||
|
const addedAttributeIds = new Set();
|
||||||
|
|
||||||
|
for (const attr of parentAttributes.concat(templateAttributes)) {
|
||||||
|
if (!addedAttributeIds.has(attr.attributeId)) {
|
||||||
|
addedAttributeIds.add(attr.attributeId);
|
||||||
|
|
||||||
|
this.attributeCache.push(attr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.inheritableAttributeCache = [];
|
this.inheritableAttributeCache = [];
|
||||||
|
|
||||||
for (const attr of this.attributeCache) {
|
for (const attr of this.attributeCache) {
|
||||||
|
@ -106,6 +106,10 @@ function buildRewardMap(note) {
|
|||||||
addToRewardMap(attr.name, reward);
|
addToRewardMap(attr.name, reward);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (attr.name === 'cliptype') {
|
||||||
|
reward /= 2;
|
||||||
|
}
|
||||||
|
|
||||||
let value = attr.value;
|
let value = attr.value;
|
||||||
|
|
||||||
if (value.startsWith('http')) {
|
if (value.startsWith('http')) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user