Skip to content

Commit 4a55897

Browse files
committed
TF-2646 Disable selection all email when toggle select item or load more emails
1 parent cb1b524 commit 4a55897

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

lib/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ class MailboxDashBoardController extends ReloadableController with UserSettingPo
253253
final isRecoveringDeletedMessage = RxBool(false);
254254
final localFileDraggableAppState = Rxn<DraggableAppState>();
255255
final isSelectAllEmailsEnabled = RxBool(false);
256+
final isSelectAllPageEnabled = RxBool(false);
256257
final markAllAsUnreadSelectionAllEmailsViewState = Rx<Either<Failure, Success>>(Right(UIState.idle));
257258
final moveAllSelectionAllEmailsViewState = Rx<Either<Failure, Success>>(Right(UIState.idle));
258259
final deleteAllPermanentlyEmailsViewState = Rx<Either<Failure, Success>>(Right(UIState.idle));
@@ -2626,6 +2627,7 @@ class MailboxDashBoardController extends ReloadableController with UserSettingPo
26262627
}
26272628

26282629
void selectAllEmailAction() {
2630+
isSelectAllPageEnabled.value = true;
26292631
dispatchAction(SelectionAllEmailAction());
26302632
}
26312633

lib/features/mailbox_dashboard/presentation/widgets/top_bar_thread_selection.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,6 @@ class TopBarThreadSelection extends StatelessWidget{
249249
}
250250
}
251251

252-
253252
EmailActionType _getActionTypeForMarkAsStar() {
254253
if (isSelectAllEmailsEnabled) {
255254
return EmailActionType.markAllAsStarred;

lib/features/thread/presentation/thread_controller.dart

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,12 @@ class ThreadController extends BaseController with EmailActionController, PopupM
766766
}
767767

768768
void selectEmail(PresentationEmail presentationEmailSelected) {
769+
if (mailboxDashBoardController.isSelectAllPageEnabled.value) {
770+
mailboxDashBoardController.isSelectAllPageEnabled.value = false;
771+
}
772+
if (mailboxDashBoardController.isSelectAllEmailsEnabled.value) {
773+
mailboxDashBoardController.isSelectAllEmailsEnabled.value = false;
774+
}
769775
final emailsInCurrentMailbox = mailboxDashBoardController.emailsInCurrentMailbox;
770776

771777
if (_rangeSelectionMode && latestEmailSelectedOrUnselected.value != null && latestEmailSelectedOrUnselected.value?.id != presentationEmailSelected.id) {
@@ -817,6 +823,7 @@ class ThreadController extends BaseController with EmailActionController, PopupM
817823
.map((email) => email.toSelectedEmail(selectMode: SelectMode.INACTIVE))
818824
.toList();
819825
mailboxDashBoardController.isSelectAllEmailsEnabled.value = false;
826+
mailboxDashBoardController.isSelectAllPageEnabled.value = false;
820827
mailboxDashBoardController.updateEmailList(newEmailList);
821828
mailboxDashBoardController.currentSelectMode.value = SelectMode.INACTIVE;
822829
mailboxDashBoardController.listEmailSelected.clear();
@@ -1389,6 +1396,12 @@ class ThreadController extends BaseController with EmailActionController, PopupM
13891396

13901397
void handleLoadMoreEmailsRequest() {
13911398
log('ThreadController::handleLoadMoreEmailsRequest:');
1399+
if (mailboxDashBoardController.isSelectAllPageEnabled.value) {
1400+
mailboxDashBoardController.isSelectAllPageEnabled.value = false;
1401+
}
1402+
if (mailboxDashBoardController.isSelectAllEmailsEnabled.value) {
1403+
mailboxDashBoardController.isSelectAllEmailsEnabled.value = false;
1404+
}
13921405
if (isSearchActive) {
13931406
_searchMoreEmails();
13941407
} else {
@@ -1397,7 +1410,7 @@ class ThreadController extends BaseController with EmailActionController, PopupM
13971410
}
13981411

13991412
bool validateToShowSelectionEmailsBanner() {
1400-
return mailboxDashBoardController.isSelectionEnabled() &&
1413+
return mailboxDashBoardController.isSelectAllPageEnabled.isTrue &&
14011414
selectedMailbox != null &&
14021415
selectedMailbox!.countTotalEmails > ThreadConstants.maxCountEmails &&
14031416
mailboxDashBoardController.listEmailSelected.length <

0 commit comments

Comments
 (0)