diff --git a/lib/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart b/lib/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart index 4b415c660a..e2001a4c01 100644 --- a/lib/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart +++ b/lib/features/mailbox_dashboard/presentation/controller/mailbox_dashboard_controller.dart @@ -406,7 +406,6 @@ class MailboxDashBoardController extends ReloadableController { _emailAddressStreamSubscription = _emailReceiveManager.pendingEmailAddressInfo.stream.listen((emailAddress) { if (emailAddress?.email?.isNotEmpty == true) { - _emailReceiveManager.clearPendingEmailAddress(); goToComposer(ComposerArguments.fromEmailAddress(emailAddress!)); } }); @@ -416,7 +415,6 @@ class MailboxDashBoardController extends ReloadableController { _emailContentStreamSubscription = _emailReceiveManager.pendingEmailContentInfo.stream.listen((emailContent) { if (emailContent?.content.isNotEmpty == true) { - _emailReceiveManager.clearPendingEmailContent(); goToComposer(ComposerArguments.fromContentShared([emailContent!].asHtmlString)); } }); @@ -426,7 +424,6 @@ class MailboxDashBoardController extends ReloadableController { _fileReceiveManagerStreamSubscription = _emailReceiveManager.pendingFileInfo.stream.listen((listFile) { if (listFile.isNotEmpty) { - _emailReceiveManager.clearPendingFileInfo(); goToComposer(ComposerArguments.fromFileShared(listFile)); } }); diff --git a/lib/main/utils/email_receive_manager.dart b/lib/main/utils/email_receive_manager.dart index 4b0943c554..2d2c84c6c2 100644 --- a/lib/main/utils/email_receive_manager.dart +++ b/lib/main/utils/email_receive_manager.dart @@ -29,16 +29,16 @@ class EmailReceiveManager { } void setPendingEmailAddress(EmailAddress emailAddress) async { - clearPendingEmailAddress(); + _clearPendingEmailAddress(); _pendingEmailAddressInfo.add(emailAddress); } void setPendingEmailContent(EmailContent emailContent) async { - clearPendingEmailAddress(); + _clearPendingEmailContent(); _pendingEmailContentInfo.add(emailContent); } - void clearPendingEmailContent() { + void _clearPendingEmailContent() { if (_pendingEmailContentInfo.isClosed) { _pendingEmailContentInfo = BehaviorSubject.seeded(null); } else { @@ -46,7 +46,7 @@ class EmailReceiveManager { } } - void clearPendingEmailAddress() { + void _clearPendingEmailAddress() { if(_pendingEmailAddressInfo.isClosed) { _pendingEmailAddressInfo = BehaviorSubject.seeded(null); } else { @@ -56,22 +56,20 @@ class EmailReceiveManager { void closeEmailReceiveManagerStream() { _pendingEmailAddressInfo.close(); + _pendingEmailContentInfo.close(); + _pendingFileInfo.close(); } void setPendingFileInfo(List list) async { - clearPendingFileInfo(); + _clearPendingFileInfo(); _pendingFileInfo.add(list); } - void clearPendingFileInfo() { + void _clearPendingFileInfo() { if(_pendingFileInfo.isClosed) { _pendingFileInfo = BehaviorSubject.seeded(List.empty(growable: true)); } else { _pendingFileInfo.add(List.empty(growable: true)); } } - - void closeFileSharingStream() { - _pendingFileInfo.close(); - } } \ No newline at end of file