Fix DriftWebOptions.onResult not being called

Closes https://github.com/simolus3/drift/discussions/3604
This commit is contained in:
Simon Binder
2025-07-09 19:58:58 +02:00
parent 2858437d02
commit 65b0a54902
2 changed files with 15 additions and 8 deletions
+4
View File
@@ -1,3 +1,7 @@
## 0.2.5-dev
- Fix `DriftWebOptions.onResult` not being called.
## 0.2.4
- Allow providing a custom temporary directory.
+11 -8
View File
@@ -20,14 +20,17 @@ QueryExecutor driftDatabase({
driftWorkerUri: web.driftWorker,
);
if (result.missingFeatures.isNotEmpty) {
// Depending how central local persistence is to your app, you may want
// to show a warning to the user if only unrealiable implemetentations
// are available.
print('Using ${result.chosenImplementation} due to missing browser '
'features: ${result.missingFeatures}');
}
(web.onResult ?? _defaultResultHandler)(result);
return result.resolvedExecutor;
}));
}
void _defaultResultHandler(WasmDatabaseResult result) {
if (result.missingFeatures.isNotEmpty) {
// Depending how central local persistence is to your app, you may want
// to show a warning to the user if only unrealiable implemetentations
// are available.
print('Using ${result.chosenImplementation} due to missing browser '
'features: ${result.missingFeatures}');
}
}