mirror of
https://github.com/immich-app/drift.git
synced 2026-09-30 13:22:57 +08:00
Fix DriftWebOptions.onResult not being called
Closes https://github.com/simolus3/drift/discussions/3604
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
## 0.2.5-dev
|
||||
|
||||
- Fix `DriftWebOptions.onResult` not being called.
|
||||
|
||||
## 0.2.4
|
||||
|
||||
- Allow providing a custom temporary directory.
|
||||
|
||||
@@ -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}');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user