forked from mystiq/hydrogen-web
make sure queries don't run into other rooms
This commit is contained in:
parent
c60840bae9
commit
03ef98e668
1 changed files with 2 additions and 2 deletions
|
@ -14,12 +14,12 @@ export default class RoomTimelineStore {
|
||||||
}
|
}
|
||||||
|
|
||||||
eventsAfter(roomId, sortKey, amount) {
|
eventsAfter(roomId, sortKey, amount) {
|
||||||
const range = IDBKeyRange.lowerBound([roomId, sortKey.buffer], true);
|
const range = IDBKeyRange.bound([roomId, sortKey.buffer], [roomId, SortKey.maxKey.buffer], true, false);
|
||||||
return this._timelineStore.selectLimit(range, amount);
|
return this._timelineStore.selectLimit(range, amount);
|
||||||
}
|
}
|
||||||
|
|
||||||
async eventsBefore(roomId, sortKey, amount) {
|
async eventsBefore(roomId, sortKey, amount) {
|
||||||
const range = IDBKeyRange.upperBound([roomId, sortKey.buffer], true);
|
const range = IDBKeyRange.bound([roomId, SortKey.minKey.buffer], [roomId, sortKey.buffer], false, true);
|
||||||
const events = await this._timelineStore.selectLimitReverse(range, amount);
|
const events = await this._timelineStore.selectLimitReverse(range, amount);
|
||||||
events.reverse(); // because we fetched them backwards
|
events.reverse(); // because we fetched them backwards
|
||||||
return events;
|
return events;
|
||||||
|
|
Loading…
Reference in a new issue