mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
use .get fallback where .getKey is not supported (Edge 15)
This commit is contained in:
parent
8e590fe53b
commit
bbf6943455
@ -17,6 +17,10 @@ export default class QueryTarget {
|
||||
}
|
||||
}
|
||||
|
||||
supports(methodName) {
|
||||
return this._target.supports(methodName);
|
||||
}
|
||||
|
||||
get(key) {
|
||||
return reqAsPromise(this._target.get(key));
|
||||
}
|
||||
|
@ -7,6 +7,10 @@ class QueryTargetWrapper {
|
||||
this._qt = qt;
|
||||
}
|
||||
|
||||
supports(methodName) {
|
||||
return !!this._qt[methodName];
|
||||
}
|
||||
|
||||
openKeyCursor(...params) {
|
||||
try {
|
||||
return this._qt.openKeyCursor(...params);
|
||||
|
@ -36,7 +36,13 @@ export default class PendingEventStore {
|
||||
|
||||
async exists(roomId, queueIndex) {
|
||||
const keyRange = IDBKeyRange.only(encodeKey(roomId, queueIndex));
|
||||
const key = await this._eventStore.getKey(keyRange);
|
||||
let key;
|
||||
if (this._eventStore.supports("getKey")) {
|
||||
key = await this._eventStore.getKey(keyRange);
|
||||
} else {
|
||||
const value = await this._eventStore.get(keyRange);
|
||||
key = value && value.key;
|
||||
}
|
||||
return !!key;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user