Add background sync runner and rejected-sync UX
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user