mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
Translate AccountDataStore
This commit is contained in:
parent
9e459aa003
commit
e0aa804971
@ -33,7 +33,7 @@ import {InboundGroupSessionStore} from "./stores/InboundGroupSessionStore";
|
||||
import {OutboundGroupSessionStore} from "./stores/OutboundGroupSessionStore";
|
||||
import {GroupSessionDecryptionStore} from "./stores/GroupSessionDecryptionStore";
|
||||
import {OperationStore} from "./stores/OperationStore";
|
||||
import {AccountDataStore} from "./stores/AccountDataStore.js";
|
||||
import {AccountDataStore} from "./stores/AccountDataStore";
|
||||
|
||||
export class Transaction {
|
||||
constructor(txn, allowedStoreNames, IDBKeyRange) {
|
||||
|
@ -13,17 +13,25 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
import {Store} from "../Store"
|
||||
|
||||
interface AccountDataEntry {
|
||||
type: string
|
||||
content: { [key : string] : any }
|
||||
}
|
||||
|
||||
export class AccountDataStore {
|
||||
constructor(store) {
|
||||
this._store = store;
|
||||
}
|
||||
private _store: Store<AccountDataEntry>
|
||||
|
||||
async get(type) {
|
||||
return await this._store.get(type);
|
||||
}
|
||||
constructor(store: Store<AccountDataEntry>) {
|
||||
this._store = store;
|
||||
}
|
||||
|
||||
set(event) {
|
||||
return this._store.put(event);
|
||||
}
|
||||
async get(type: string): Promise<AccountDataEntry | null> {
|
||||
return await this._store.get(type);
|
||||
}
|
||||
|
||||
set(event: AccountDataEntry): Promise<IDBValidKey> {
|
||||
return this._store.put(event);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user