Skip to content

Commit 048d432

Browse files
committed
fix(feed): improve feed decorator status updates and popup menu
- Enhance logic for updating UserFeedDecoratorStatus in AppBloc - Fix type of PopupMenuButton in ContentCollectionView
1 parent 5b9aff1 commit 048d432

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

lib/app/bloc/app_bloc.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,12 @@ class AppBloc extends Bloc<AppEvent, AppState> {
361361
const UserFeedDecoratorStatus(isCompleted: false);
362362

363363
final updatedDecoratorStatus = currentStatus.copyWith(
364+
// Always update the last shown timestamp.
364365
lastShownAt: now,
365-
isCompleted: event.isCompleted || currentStatus.isCompleted,
366+
// If the event marks it as completed, it should be completed.
367+
// Otherwise, respect the existing completion status. This prevents
368+
// a non-completed event from overriding a completed one.
369+
isCompleted: event.isCompleted ? true : currentStatus.isCompleted,
366370
);
367371

368372
final newFeedDecoratorStatus =

lib/feed_decorators/widgets/content_collection_decorator_widget.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,13 @@ class _ContentCollectionViewState extends State<_ContentCollectionView> {
113113
),
114114
),
115115
if (widget.onDismiss != null)
116-
PopupMenuButton<void>(
116+
PopupMenuButton<String>(
117117
icon: const Icon(Icons.more_vert),
118118
tooltip: l10n.decoratorDismissAction,
119119
onSelected: (_) => widget.onDismiss!(),
120120
itemBuilder: (BuildContext context) => [
121-
PopupMenuItem<void>(
122-
value: null,
121+
PopupMenuItem<String>(
122+
value: 'dismiss',
123123
child: Text(l10n.decoratorDismissAction),
124124
),
125125
],

0 commit comments

Comments
 (0)