mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-11 04:27:40 +01:00
check only in remoteEntries
This commit is contained in:
parent
3c28ee1adf
commit
4fa32bac2f
@ -344,7 +344,7 @@ export class Timeline {
|
|||||||
* @returns entry if found, undefined otherwise
|
* @returns entry if found, undefined otherwise
|
||||||
*/
|
*/
|
||||||
_findLoadedEventById(eventId) {
|
_findLoadedEventById(eventId) {
|
||||||
return this.getFromAllEntriesById(eventId) ?? this._contextEntriesNotInTimeline.get(eventId);
|
return this.getByEventId(eventId) ?? this._contextEntriesNotInTimeline.get(eventId);
|
||||||
}
|
}
|
||||||
|
|
||||||
async _getEventFromStorage(eventId) {
|
async _getEventFromStorage(eventId) {
|
||||||
@ -423,19 +423,6 @@ export class Timeline {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
getFromAllEntriesById(eventId) {
|
|
||||||
if (!this._allEntries) {
|
|
||||||
// if allEntries isn't loaded yet, fallback to looking only in remoteEntries
|
|
||||||
return this.getByEventId(eventId);
|
|
||||||
}
|
|
||||||
for (const entry of this._allEntries) {
|
|
||||||
if (entry.id === eventId) {
|
|
||||||
return entry;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @public */
|
/** @public */
|
||||||
get entries() {
|
get entries() {
|
||||||
return this._allEntries;
|
return this._allEntries;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user