Change ObjectBox inserts to use queued instead of async

This commit is contained in:
Hank Grabowski 2023-06-27 13:16:01 -04:00
parent b68e9a999e
commit 0d70a95606

View file

@ -95,8 +95,10 @@ class ObjectBoxConnectionsRepo implements IConnectionsRepo {
bool upsertConnection(Connection connection) {
memCache.upsertConnection(connection);
getById(connection.id).match(
onSuccess: (existing) => box.put(connection.copy(obId: existing.obId)),
onError: (_) => box.put(connection),
onSuccess: (existing) => box.putQueued(
connection.copy(obId: existing.obId),
),
onError: (_) => box.putQueued(connection),
);
return true;
}