TF-1793 Add spam mailbox to canDeletePermanently condition
(cherry picked from commit 242122dcb187c1032208de4a756b250bb5335087)
This commit is contained in:
@@ -117,17 +117,17 @@ class EmailViewAppBarWidget extends StatelessWidget {
|
||||
iconSize: EmailViewAppBarWidgetStyles.deleteButtonIconSize,
|
||||
backgroundColor: Colors.transparent,
|
||||
padding: EmailViewAppBarWidgetStyles.buttonPadding,
|
||||
iconColor: mailboxContain?.isTrash == false
|
||||
? EmailViewAppBarWidgetStyles.emptyTrashButtonColor
|
||||
: EmailViewAppBarWidgetStyles.deletePermanentButtonColor,
|
||||
tooltipMessage: mailboxContain?.isTrash == false
|
||||
? AppLocalizations.of(context).move_to_trash
|
||||
: AppLocalizations.of(context).delete_permanently,
|
||||
iconColor: canDeletePermanently
|
||||
? EmailViewAppBarWidgetStyles.deletePermanentButtonColor
|
||||
: EmailViewAppBarWidgetStyles.emptyTrashButtonColor,
|
||||
tooltipMessage: canDeletePermanently
|
||||
? AppLocalizations.of(context).delete_permanently
|
||||
: AppLocalizations.of(context).move_to_trash,
|
||||
onTapActionCallback: () {
|
||||
if (mailboxContain?.isTrash == false) {
|
||||
onEmailActionClick?.call(presentationEmail, EmailActionType.moveToTrash);
|
||||
} else {
|
||||
if (canDeletePermanently) {
|
||||
onEmailActionClick?.call(presentationEmail, EmailActionType.deletePermanently);
|
||||
} else {
|
||||
onEmailActionClick?.call(presentationEmail, EmailActionType.moveToTrash);
|
||||
}
|
||||
}
|
||||
),
|
||||
@@ -165,4 +165,8 @@ class EmailViewAppBarWidget extends StatelessWidget {
|
||||
isSearchActivated;
|
||||
}
|
||||
}
|
||||
|
||||
bool get canDeletePermanently {
|
||||
return mailboxContain?.isTrash == true || mailboxContain?.isSpam == true;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -152,5 +152,5 @@ class SelectionWebAppBarThreadWidget extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
bool get _deletePermanentlyValid => mailboxSelected?.isTrash == true || mailboxSelected?.isDrafts == true;
|
||||
bool get _deletePermanentlyValid => mailboxSelected?.isTrash == true || mailboxSelected?.isDrafts == true || mailboxSelected?.isSpam == true;
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ class BottomBarThreadSelectionWidget extends StatelessWidget{
|
||||
}
|
||||
|
||||
bool get canDeletePermanently {
|
||||
return _currentMailbox?.isTrash == true || _currentMailbox?.isDrafts == true;
|
||||
return _currentMailbox?.isTrash == true || _currentMailbox?.isDrafts == true || _currentMailbox?.isSpam == true;
|
||||
}
|
||||
|
||||
bool _verticalDirection(BuildContext context) {
|
||||
|
||||
@@ -477,7 +477,7 @@ class EmailTileBuilder with BaseEmailItemTile {
|
||||
}
|
||||
|
||||
bool get canDeletePermanently {
|
||||
return mailboxContain?.isTrash == true || mailboxContain?.isDrafts == true;
|
||||
return mailboxContain?.isTrash == true || mailboxContain?.isDrafts == true || mailboxContain?.isSpam == true;
|
||||
}
|
||||
|
||||
Widget _buildDateTimeForDesktopScreen() {
|
||||
|
||||
@@ -27,7 +27,8 @@ extension ListPresentationEmailExtension on List<PresentationEmail> {
|
||||
.whereType<PresentationMailbox>()
|
||||
.toList();
|
||||
final stateDelete = listMailboxContain.every((mailbox) => mailbox.isTrash) ||
|
||||
listMailboxContain.every((mailbox) => mailbox.isDrafts);
|
||||
listMailboxContain.every((mailbox) => mailbox.isDrafts) ||
|
||||
listMailboxContain.every((mailbox) => mailbox.isSpam);
|
||||
return stateDelete;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user