fix: resolve navigation-cache regressions and todo UX
This commit is contained in:
@@ -46,11 +46,7 @@ class TodoRepository {
|
||||
);
|
||||
if (cached != null) {
|
||||
final next = cached.value
|
||||
.map(
|
||||
(todo) => todo.id == id
|
||||
? todo.copyWith(status: 'completed', completedAt: now())
|
||||
: todo,
|
||||
)
|
||||
.where((todo) => todo.id != id)
|
||||
.toList(growable: false);
|
||||
await store.write<CacheEntry<List<TodoResponse>>>(
|
||||
pendingListKey,
|
||||
@@ -58,9 +54,9 @@ class TodoRepository {
|
||||
);
|
||||
}
|
||||
|
||||
invalidator.invalidate(pendingListKey);
|
||||
try {
|
||||
await api.completeTodo(id);
|
||||
invalidator.invalidate(pendingListKey);
|
||||
} catch (error) {
|
||||
if (cached != null) {
|
||||
await store.write<CacheEntry<List<TodoResponse>>>(
|
||||
|
||||
Reference in New Issue
Block a user