forked from mystiq/hydrogen-web
Check in all entries for context
This commit is contained in:
parent
73733ce145
commit
5c1813888c
1 changed files with 12 additions and 2 deletions
|
@ -337,12 +337,12 @@ export class Timeline {
|
|||
}
|
||||
|
||||
/**
|
||||
* Fetches an entry with the given event-id from remoteEntries or contextEntriesNotInTimeline.
|
||||
* Fetches an entry with the given event-id from localEntries, remoteEntries or contextEntriesNotInTimeline.
|
||||
* @param {string} eventId event-id of the entry
|
||||
* @returns entry if found, undefined otherwise
|
||||
*/
|
||||
_findLoadedEventById(eventId) {
|
||||
return this.getByEventId(eventId) ?? this._contextEntriesNotInTimeline.get(eventId);
|
||||
return this.getFromAllEntriesById(eventId) ?? this._contextEntriesNotInTimeline.get(eventId);
|
||||
}
|
||||
|
||||
async _getEventFromStorage(eventId) {
|
||||
|
@ -421,6 +421,16 @@ export class Timeline {
|
|||
return null;
|
||||
}
|
||||
|
||||
getFromAllEntriesById(eventId) {
|
||||
for (let i = 0; i < this.entries.length; i += 1) {
|
||||
const entry = this.entries.get(i);
|
||||
if (entry.id === eventId) {
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/** @public */
|
||||
get entries() {
|
||||
return this._allEntries;
|
||||
|
|
Loading…
Reference in a new issue