mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-11-20 03:25:52 +01:00
Remove isLoadedFromStorage parameter
We don't really need this because we use context entries
This commit is contained in:
parent
626c3053d2
commit
1ef57b87da
@ -19,16 +19,15 @@ import {getPrevContentFromStateEvent, isRedacted} from "../../common";
|
||||
import {getRelationFromContent, getRelatedEventId} from "../relations.js";
|
||||
|
||||
export class EventEntry extends BaseEventEntry {
|
||||
constructor(eventEntry, fragmentIdComparer, isLoadedFromStorage = false) {
|
||||
constructor(eventEntry, fragmentIdComparer) {
|
||||
super(fragmentIdComparer);
|
||||
this._eventEntry = eventEntry;
|
||||
this._decryptionError = null;
|
||||
this._decryptionResult = null;
|
||||
this._isLoadedFromStorage = isLoadedFromStorage;
|
||||
}
|
||||
|
||||
clone() {
|
||||
const clone = new EventEntry(this._eventEntry, this._fragmentIdComparer, this._isLoadedFromStorage);
|
||||
const clone = new EventEntry(this._eventEntry, this._fragmentIdComparer);
|
||||
clone.updateFrom(this);
|
||||
return clone;
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ async function readRawTimelineEntriesWithTxn(roomId, eventKey, direction, amount
|
||||
} else {
|
||||
eventsWithinFragment = await timelineStore.eventsBefore(roomId, eventKey, amount);
|
||||
}
|
||||
let eventEntries = eventsWithinFragment.map(e => new EventEntry(e, fragmentIdComparer, true));
|
||||
let eventEntries = eventsWithinFragment.map(e => new EventEntry(e, fragmentIdComparer));
|
||||
entries = directionalConcat(entries, eventEntries, direction);
|
||||
// prepend or append eventsWithinFragment to entries, and wrap them in EventEntry
|
||||
|
||||
@ -140,7 +140,7 @@ export class TimelineReader {
|
||||
const txn = await this._storage.readTxn(stores); // todo: can we just use this.readTxnStores here? probably
|
||||
const storageEntry = await txn.timelineEvents.getByEventId(this._roomId, id);
|
||||
if (storageEntry) {
|
||||
const entry = new EventEntry(storageEntry, this._fragmentIdComparer, true);
|
||||
const entry = new EventEntry(storageEntry, this._fragmentIdComparer);
|
||||
if (this._decryptEntries) {
|
||||
const request = this._decryptEntries([entry], txn, log);
|
||||
await request.complete();
|
||||
|
Loading…
Reference in New Issue
Block a user