Fix store

This commit is contained in:
Christian Pauly 2020-01-30 13:45:35 +00:00
parent 519f32c8d1
commit 41577ada6d

View File

@ -15,7 +15,7 @@ class Store extends StoreAPI {
final FlutterSecureStorage secureStorage;
Store(this.client)
: storage = !kIsWeb ? null : LocalStorage('LocalStorage'),
: storage = LocalStorage('LocalStorage'),
secureStorage = kIsWeb ? null : FlutterSecureStorage() {
_init();
}
@ -351,8 +351,8 @@ class ExtendedStore extends Store implements ExtendedStoreAPI {
if (type == "history") return null;
if (type != "account_data" && eventUpdate.content["event_id"] != null ||
eventUpdate.content["state_key"] != null) {
if (type != "account_data" &&
eventUpdate.content.containsKey("state_key")) {
final String now = DateTime.now().millisecondsSinceEpoch.toString();
txn.rawInsert(
"INSERT OR REPLACE INTO RoomStates VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)",