mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
remove unused storage modification functions
This commit is contained in:
parent
f993048a2b
commit
43d430fc98
@ -253,11 +253,6 @@ export class TimelineEventStore {
|
|||||||
get(roomId, eventKey) {
|
get(roomId, eventKey) {
|
||||||
return this._timelineStore.get(encodeKey(roomId, eventKey.fragmentId, eventKey.eventIndex));
|
return this._timelineStore.get(encodeKey(roomId, eventKey.fragmentId, eventKey.eventIndex));
|
||||||
}
|
}
|
||||||
// returns the entries as well!! (or not always needed? I guess not always needed, so extra method)
|
|
||||||
removeRange(roomId, range) {
|
|
||||||
// TODO: read the entries!
|
|
||||||
return this._timelineStore.delete(range.asIDBKeyRange(roomId));
|
|
||||||
}
|
|
||||||
|
|
||||||
getByEventId(roomId, eventId) {
|
getByEventId(roomId, eventId) {
|
||||||
return this._timelineStore.index("byEventId").get(encodeEventIdKey(roomId, eventId));
|
return this._timelineStore.index("byEventId").get(encodeEventIdKey(roomId, eventId));
|
||||||
|
@ -151,17 +151,6 @@ export async function select(db, storeName, toCursor, isDone) {
|
|||||||
return await fetchResults(cursor, isDone);
|
return await fetchResults(cursor, isDone);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function updateSingletonStore(db, storeName, value) {
|
|
||||||
const tx = db.transaction([storeName], "readwrite");
|
|
||||||
const store = tx.objectStore(storeName);
|
|
||||||
const cursor = await reqAsPromise(store.openCursor());
|
|
||||||
if (cursor) {
|
|
||||||
return reqAsPromise(cursor.update(storeName));
|
|
||||||
} else {
|
|
||||||
return reqAsPromise(store.add(value));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function findStoreValue(db, storeName, toCursor, matchesValue) {
|
export async function findStoreValue(db, storeName, toCursor, matchesValue) {
|
||||||
if (!matchesValue) {
|
if (!matchesValue) {
|
||||||
matchesValue = () => true;
|
matchesValue = () => true;
|
||||||
|
@ -234,11 +234,4 @@ export class RoomTimelineStore extends Store {
|
|||||||
const event = count ? this._timeline[startIndex] : undefined;
|
const event = count ? this._timeline[startIndex] : undefined;
|
||||||
return Promise.resolve(event);
|
return Promise.resolve(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
removeRange(roomId, range) {
|
|
||||||
this.assertWritable();
|
|
||||||
const {startIndex, count} = range.project(roomId);
|
|
||||||
const removedEntries = this._timeline.splice(startIndex, count);
|
|
||||||
return Promise.resolve(removedEntries);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user