mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
safari doesn't like empty string key paths 🙄
This commit is contained in:
parent
bb6417dab9
commit
eee1be1ceb
@ -140,5 +140,5 @@ async function migrateOperationScopeIndex(db, txn) {
|
||||
|
||||
//v10
|
||||
function createTimelineRelationsStore(db) {
|
||||
db.createObjectStore("timelineRelations", {keyPath: ""});
|
||||
}
|
||||
db.createObjectStore("timelineRelations", {keyPath: "key"});
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ export class TimelineRelationStore {
|
||||
}
|
||||
|
||||
add(roomId, targetEventId, relType, sourceEventId) {
|
||||
return this._store.add(encodeKey(roomId, targetEventId, relType, sourceEventId));
|
||||
return this._store.add({key: encodeKey(roomId, targetEventId, relType, sourceEventId)});
|
||||
}
|
||||
|
||||
remove(roomId, targetEventId, relType, sourceEventId) {
|
||||
@ -56,8 +56,8 @@ export class TimelineRelationStore {
|
||||
true,
|
||||
true
|
||||
);
|
||||
const keys = await this._store.selectAll(range);
|
||||
return keys.map(decodeKey);
|
||||
const items = await this._store.selectAll(range);
|
||||
return items.map(i => decodeKey(i.key));
|
||||
}
|
||||
|
||||
async getAllForTarget(roomId, targetId) {
|
||||
@ -69,7 +69,7 @@ export class TimelineRelationStore {
|
||||
true,
|
||||
true
|
||||
);
|
||||
const keys = await this._store.selectAll(range);
|
||||
return keys.map(decodeKey);
|
||||
const items = await this._store.selectAll(range);
|
||||
return items.map(i => decodeKey(i.key));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user