Optimize and refactor for MailboxVisibility
This commit is contained in:
@@ -4,7 +4,7 @@ import 'package:model/mailbox/presentation_mailbox.dart';
|
||||
extension ListPresentationMailboxExtension on List<PresentationMailbox> {
|
||||
|
||||
List<PresentationMailbox> get listSubscribedMailboxes =>
|
||||
where((mailbox) => mailbox.supportedSubscribe).toList();
|
||||
where((mailbox) => mailbox.isSubscribedMailbox).toList();
|
||||
|
||||
List<PresentationMailbox> get listPersonalMailboxes =>
|
||||
where((mailbox) => mailbox.isPersonal).toList();
|
||||
|
||||
@@ -103,10 +103,8 @@ class PresentationMailbox with EquatableMixin {
|
||||
(namespace?.value.indexOf('[') ?? 0) + 1,
|
||||
namespace?.value.indexOf(']'));
|
||||
|
||||
bool get supportedSubscribe => isSubscribed?.value == true;
|
||||
|
||||
bool get isSupportedDisableMailbox {
|
||||
if (!supportedSubscribe) {
|
||||
if (!isSubscribedMailbox) {
|
||||
return false;
|
||||
}
|
||||
if (isPersonal) {
|
||||
@@ -117,7 +115,7 @@ class PresentationMailbox with EquatableMixin {
|
||||
}
|
||||
|
||||
bool get isSupportedEnableMailbox {
|
||||
if (supportedSubscribe) {
|
||||
if (isSubscribedMailbox) {
|
||||
return false;
|
||||
}
|
||||
if (isPersonal) {
|
||||
|
||||
Reference in New Issue
Block a user