don't try to hook up local relations for events that are not relations
and do unnecessary work
This commit is contained in:
parent
365bd5cad0
commit
d2f5b412ac
1 changed files with 10 additions and 5 deletions
|
@ -120,12 +120,17 @@ export class Timeline {
|
||||||
return params ? params : false;
|
return params ? params : false;
|
||||||
};
|
};
|
||||||
// first, look in local entries based on txn id
|
// first, look in local entries based on txn id
|
||||||
const foundInLocalEntries = this._localEntries.findAndUpdate(
|
if (pe.relatedTxnId) {
|
||||||
e => e.id === pe.relatedTxnId,
|
const found = this._localEntries.findAndUpdate(
|
||||||
updateOrFalse,
|
e => e.id === pe.relatedTxnId,
|
||||||
);
|
updateOrFalse,
|
||||||
|
);
|
||||||
|
if (found) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
// now look in remote entries based on event id
|
// now look in remote entries based on event id
|
||||||
if (!foundInLocalEntries && pe.relatedEventId) {
|
if (pe.relatedEventId) {
|
||||||
this._remoteEntries.findAndUpdate(
|
this._remoteEntries.findAndUpdate(
|
||||||
e => e.id === pe.relatedEventId,
|
e => e.id === pe.relatedEventId,
|
||||||
updateOrFalse
|
updateOrFalse
|
||||||
|
|
Reference in a new issue