Add background sync runner and rejected-sync UX

This commit is contained in:
Rijad Zuzo
2026-02-15 20:13:12 +01:00
parent add0105e6b
commit 497805ed3b
8 changed files with 361 additions and 2 deletions
@@ -127,6 +127,22 @@ class SyncQueueRepository extends AsyncNotifier<SyncState> {
);
}
/// Clears the latest rejection payload shown to the user.
Future<void> clearRejections() async {
final SyncState current = await _currentState();
final String? lastError =
current.lastError != null &&
current.lastError!.startsWith('Push rejected')
? null
: current.lastError;
await _setState(
current.copyWith(
lastRejected: const <MutationRejection>[],
lastError: lastError,
),
);
}
Future<SyncState> _currentState() async {
final SyncState? value = state.asData?.value;
if (value != null) {