Skip to content

Commit c2da7f8

Browse files
committed
fix(content_management): preserve snackbar data across state changes
- Update DraftTopicsState.copyWith to maintain lastPendingDeletionId and snackbarTopicTitle when they are null - This prevents loss of snackbar data when updating other state properties
1 parent 56870d5 commit c2da7f8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/content_management/bloc/draft_topics/draft_topics_state.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@ class DraftTopicsState extends Equatable {
8282
// to ensure they are cleared after being handled.
8383
exception: exception,
8484
publishedTopic: publishedTopic,
85-
lastPendingDeletionId: lastPendingDeletionId,
86-
snackbarTopicTitle: snackbarTopicTitle,
85+
lastPendingDeletionId:
86+
lastPendingDeletionId ?? this.lastPendingDeletionId,
87+
snackbarTopicTitle: snackbarTopicTitle ?? this.snackbarTopicTitle,
8788
);
8889
}
8990

0 commit comments

Comments
 (0)