mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-10 20:17:32 +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
|
//v10
|
||||||
function createTimelineRelationsStore(db) {
|
function createTimelineRelationsStore(db) {
|
||||||
db.createObjectStore("timelineRelations", {keyPath: ""});
|
db.createObjectStore("timelineRelations", {keyPath: "key"});
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ export class TimelineRelationStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
add(roomId, targetEventId, relType, sourceEventId) {
|
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) {
|
remove(roomId, targetEventId, relType, sourceEventId) {
|
||||||
@ -56,8 +56,8 @@ export class TimelineRelationStore {
|
|||||||
true,
|
true,
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
const keys = await this._store.selectAll(range);
|
const items = await this._store.selectAll(range);
|
||||||
return keys.map(decodeKey);
|
return items.map(i => decodeKey(i.key));
|
||||||
}
|
}
|
||||||
|
|
||||||
async getAllForTarget(roomId, targetId) {
|
async getAllForTarget(roomId, targetId) {
|
||||||
@ -69,7 +69,7 @@ export class TimelineRelationStore {
|
|||||||
true,
|
true,
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
const keys = await this._store.selectAll(range);
|
const items = await this._store.selectAll(range);
|
||||||
return keys.map(decodeKey);
|
return items.map(i => decodeKey(i.key));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user