Skip to content

Commit 6ad0411

Browse files
committed
fix(local-ads): prevent status modification during local video ad update
- Remove status update functionality from UpdateLocalVideoAdBloc - Maintain original status when submitting updated ad - Remove related UI components for status display and update
1 parent 224293d commit 6ad0411

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

lib/local_ads_management/bloc/update_local_ads/update_local_video_ad_bloc.dart

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ class UpdateLocalVideoAdBloc
2121
on<UpdateLocalVideoAdLoaded>(_onLoaded);
2222
on<UpdateLocalVideoAdVideoUrlChanged>(_onVideoUrlChanged);
2323
on<UpdateLocalVideoAdTargetUrlChanged>(_onTargetUrlChanged);
24-
on<UpdateLocalVideoAdStatusChanged>(_onStatusChanged);
2524
on<UpdateLocalVideoAdSubmitted>(_onSubmitted);
2625

2726
add(UpdateLocalVideoAdLoaded(_id));
@@ -44,7 +43,6 @@ class UpdateLocalVideoAdBloc
4443
initialAd: localVideoAd,
4544
videoUrl: localVideoAd.videoUrl,
4645
targetUrl: localVideoAd.targetUrl,
47-
contentStatus: localVideoAd.status,
4846
),
4947
);
5048
} on HttpException catch (e) {
@@ -75,13 +73,6 @@ class UpdateLocalVideoAdBloc
7573
emit(state.copyWith(targetUrl: event.targetUrl));
7674
}
7775

78-
void _onStatusChanged(
79-
UpdateLocalVideoAdStatusChanged event,
80-
Emitter<UpdateLocalVideoAdState> emit,
81-
) {
82-
emit(state.copyWith(contentStatus: event.status));
83-
}
84-
8576
Future<void> _onSubmitted(
8677
UpdateLocalVideoAdSubmitted event,
8778
Emitter<UpdateLocalVideoAdState> emit,
@@ -95,7 +86,7 @@ class UpdateLocalVideoAdBloc
9586
videoUrl: state.videoUrl,
9687
targetUrl: state.targetUrl,
9788
updatedAt: now,
98-
status: state.contentStatus,
89+
status: state.initialAd!.status, // Maintain original status
9990
);
10091

10192
await _localAdsRepository.update(

0 commit comments

Comments
 (0)