Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] TF-3335 Improve move email jmap requests #3363

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions lib/features/mailbox/presentation/mailbox_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import 'package:tmail_ui_user/features/email/domain/state/delete_email_permanent
import 'package:tmail_ui_user/features/email/domain/state/delete_multiple_emails_permanently_state.dart';
import 'package:tmail_ui_user/features/email/domain/state/get_restored_deleted_message_state.dart';
import 'package:tmail_ui_user/features/email/domain/state/mark_as_email_read_state.dart';
import 'package:tmail_ui_user/features/email/domain/state/move_to_mailbox_state.dart';
import 'package:tmail_ui_user/features/email/presentation/model/composer_arguments.dart';
import 'package:tmail_ui_user/features/home/data/exceptions/session_exceptions.dart';
import 'package:tmail_ui_user/features/home/domain/extensions/session_extensions.dart';
Expand Down Expand Up @@ -92,7 +91,6 @@ import 'package:tmail_ui_user/features/thread/domain/model/search_query.dart';
import 'package:tmail_ui_user/features/thread/domain/state/empty_spam_folder_state.dart';
import 'package:tmail_ui_user/features/thread/domain/state/empty_trash_folder_state.dart';
import 'package:tmail_ui_user/features/thread/domain/state/mark_as_multiple_email_read_state.dart';
import 'package:tmail_ui_user/features/thread/domain/state/move_multiple_email_to_mailbox_state.dart';
import 'package:tmail_ui_user/main/localizations/app_localizations.dart';
import 'package:tmail_ui_user/main/routes/app_routes.dart';
import 'package:tmail_ui_user/main/routes/dialog_router.dart';
Expand Down Expand Up @@ -272,10 +270,6 @@ class MailboxController extends BaseMailboxController
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
} else if (success is MarkAsMultipleEmailReadHasSomeEmailFailure) {
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
Comment on lines 271 to 272
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whay not handle flags update at the same time?

} else if (success is MoveMultipleEmailToMailboxAllSuccess) {
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
} else if (success is MoveMultipleEmailToMailboxHasSomeEmailFailure) {
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
} else if (success is DeleteMultipleEmailsPermanentlyAllSuccess) {
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
} else if (success is DeleteMultipleEmailsPermanentlyHasSomeEmailFailure) {
Expand All @@ -284,8 +278,6 @@ class MailboxController extends BaseMailboxController
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
} else if (success is MarkAsEmailReadSuccess) {
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
} else if (success is MoveToMailboxSuccess) {
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
} else if (success is DeleteEmailPermanentlySuccess) {
_refreshMailboxChanges(currentMailboxState: success.currentMailboxState);
} else if (success is SaveEmailAsDraftsSuccess) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import 'package:tmail_ui_user/features/email/domain/state/delete_email_permanent
import 'package:tmail_ui_user/features/email/domain/state/delete_multiple_emails_permanently_state.dart';
import 'package:tmail_ui_user/features/email/domain/state/mark_as_email_read_state.dart';
import 'package:tmail_ui_user/features/email/domain/state/mark_as_email_star_state.dart';
import 'package:tmail_ui_user/features/email/domain/state/move_to_mailbox_state.dart';
import 'package:tmail_ui_user/features/email/domain/state/store_event_attendance_status_state.dart';
import 'package:tmail_ui_user/features/email/domain/state/unsubscribe_email_state.dart';
import 'package:tmail_ui_user/features/email/presentation/utils/email_utils.dart';
Expand Down Expand Up @@ -66,7 +65,6 @@ import 'package:tmail_ui_user/features/thread/domain/state/empty_spam_folder_sta
import 'package:tmail_ui_user/features/thread/domain/state/empty_trash_folder_state.dart';
import 'package:tmail_ui_user/features/thread/domain/state/mark_as_multiple_email_read_state.dart';
import 'package:tmail_ui_user/features/thread/domain/state/mark_as_star_multiple_email_state.dart';
import 'package:tmail_ui_user/features/thread/domain/state/move_multiple_email_to_mailbox_state.dart';
import 'package:tmail_ui_user/features/thread/domain/state/search_email_state.dart';
import 'package:tmail_ui_user/features/thread/domain/state/search_more_email_state.dart';
import 'package:tmail_ui_user/features/thread/domain/usecases/search_email_interactor.dart';
Expand Down Expand Up @@ -251,15 +249,12 @@ class SearchEmailController extends BaseController
dashBoardViewStateWorker = ever(mailboxDashBoardController.viewState, (viewState) {
viewState.map((success) {
if (success is MarkAsEmailReadSuccess ||
success is MoveToMailboxSuccess ||
success is MarkAsStarEmailSuccess ||
success is DeleteEmailPermanentlySuccess ||
success is MarkAsMultipleEmailReadAllSuccess ||
success is MarkAsMultipleEmailReadHasSomeEmailFailure ||
success is MarkAsStarMultipleEmailAllSuccess ||
success is MarkAsStarMultipleEmailHasSomeEmailFailure ||
success is MoveMultipleEmailToMailboxAllSuccess ||
success is MoveMultipleEmailToMailboxHasSomeEmailFailure ||
success is EmptyTrashFolderSuccess ||
success is EmptySpamFolderSuccess ||
success is DeleteMultipleEmailsPermanentlyAllSuccess ||
Expand Down
8 changes: 0 additions & 8 deletions lib/features/thread/presentation/thread_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import 'package:tmail_ui_user/features/email/domain/state/delete_email_permanent
import 'package:tmail_ui_user/features/email/domain/state/delete_multiple_emails_permanently_state.dart';
import 'package:tmail_ui_user/features/email/domain/state/mark_as_email_read_state.dart';
import 'package:tmail_ui_user/features/email/domain/state/mark_as_email_star_state.dart';
import 'package:tmail_ui_user/features/email/domain/state/move_to_mailbox_state.dart';
import 'package:tmail_ui_user/features/email/domain/state/store_event_attendance_status_state.dart';
import 'package:tmail_ui_user/features/email/domain/state/unsubscribe_email_state.dart';
import 'package:tmail_ui_user/features/email/presentation/action/email_ui_action.dart';
Expand Down Expand Up @@ -58,7 +57,6 @@ import 'package:tmail_ui_user/features/thread/domain/state/get_email_by_id_state
import 'package:tmail_ui_user/features/thread/domain/state/load_more_emails_state.dart';
import 'package:tmail_ui_user/features/thread/domain/state/mark_as_multiple_email_read_state.dart';
import 'package:tmail_ui_user/features/thread/domain/state/mark_as_star_multiple_email_state.dart';
import 'package:tmail_ui_user/features/thread/domain/state/move_multiple_email_to_mailbox_state.dart';
import 'package:tmail_ui_user/features/thread/domain/state/refresh_all_email_state.dart';
import 'package:tmail_ui_user/features/thread/domain/state/refresh_changes_all_email_state.dart';
import 'package:tmail_ui_user/features/thread/domain/state/search_email_state.dart';
Expand Down Expand Up @@ -347,8 +345,6 @@ class ThreadController extends BaseController with EmailActionController {
viewState.map((success) {
if (success is MarkAsEmailReadSuccess) {
_refreshEmailChanges(currentEmailState: success.currentEmailState);
} else if (success is MoveToMailboxSuccess) {
_refreshEmailChanges(currentEmailState: success.currentEmailState);
} else if (success is MarkAsStarEmailSuccess) {
_refreshEmailChanges(currentEmailState: success.currentEmailState);
} else if (success is DeleteEmailPermanentlySuccess) {
Expand All @@ -365,10 +361,6 @@ class ThreadController extends BaseController with EmailActionController {
_refreshEmailChanges(currentEmailState: success.currentEmailState);
} else if (success is MarkAsMailboxReadHasSomeEmailFailure) {
_refreshEmailChanges(currentEmailState: success.currentEmailState);
} else if (success is MoveMultipleEmailToMailboxAllSuccess) {
_refreshEmailChanges(currentEmailState: success.currentEmailState);
} else if (success is MoveMultipleEmailToMailboxHasSomeEmailFailure) {
_refreshEmailChanges(currentEmailState: success.currentEmailState);
} else if (success is DeleteMultipleEmailsPermanentlyAllSuccess) {
_refreshEmailChanges(currentEmailState: success.currentEmailState);
} else if (success is DeleteMultipleEmailsPermanentlyHasSomeEmailFailure) {
Expand Down
Loading