diff --git a/lib/features/composer/domain/usecases/save_composer_cache_on_web_interactor.dart b/lib/features/composer/domain/usecases/save_composer_cache_on_web_interactor.dart index 8573cf380..7e11038a5 100644 --- a/lib/features/composer/domain/usecases/save_composer_cache_on_web_interactor.dart +++ b/lib/features/composer/domain/usecases/save_composer_cache_on_web_interactor.dart @@ -36,7 +36,7 @@ class SaveComposerCacheOnWebInteractor { email: emailCreated, hasRequestReadReceipt: createEmailRequest.hasRequestReadReceipt, isMarkAsImportant: createEmailRequest.isMarkAsImportant, - displayMode: createEmailRequest.displayMode + displayMode: createEmailRequest.displayMode, composerIndex: createEmailRequest.composerIndex, composerId: createEmailRequest.composerId, )); diff --git a/lib/features/composer/presentation/composer_bindings.dart b/lib/features/composer/presentation/composer_bindings.dart index ad62c8093..7864fe746 100644 --- a/lib/features/composer/presentation/composer_bindings.dart +++ b/lib/features/composer/presentation/composer_bindings.dart @@ -84,7 +84,7 @@ class ComposerBindings extends BaseBindings { @override void bindingsDataSourceImpl() { Get.lazyPut(() => AttachmentUploadDataSourceImpl( - Get.find(tag: composerId), + Get.find(), Get.find(), Get.find(), ), tag: composerId); @@ -142,6 +142,10 @@ class ComposerBindings extends BaseBindings { Get.find(), Get.find(), ), tag: composerId); + Get.lazyPut(() => SessionStorageComposerDatasourceImpl( + Get.find(), + Get.find(), + ), tag: composerId); } @override @@ -178,6 +182,10 @@ class ComposerBindings extends BaseBindings { () => Get.find(tag: composerId), tag: composerId, ); + Get.lazyPut( + () => Get.find(tag: composerId), + tag: composerId, + ); } @override @@ -293,7 +301,7 @@ class ComposerBindings extends BaseBindings { ); IdentityInteractorsBindings(composerId: composerId).dependencies(); - PreferencesInteractorsBindings().dependencies(); + PreferencesInteractorsBindings(composerId: composerId).dependencies(); } @override @@ -347,7 +355,6 @@ class ComposerBindings extends BaseBindings { Get.delete(tag: composerId); Get.delete(tag: composerId); Get.delete(tag: composerId); - Get.delete(tag: composerId); Get.delete(tag: composerId); Get.delete(tag: composerId); @@ -358,7 +365,6 @@ class ComposerBindings extends BaseBindings { Get.delete(tag: composerId); Get.delete(tag: composerId); Get.delete(tag: composerId); - Get.delete(tag: composerId); Get.delete(tag: composerId); Get.delete(tag: composerId); @@ -366,14 +372,12 @@ class ComposerBindings extends BaseBindings { Get.delete(tag: composerId); Get.delete(tag: composerId); Get.delete(tag: composerId); - Get.delete(tag: composerId); Get.delete(tag: composerId); Get.delete(tag: composerId); Get.delete(tag: composerId); Get.delete(tag: composerId); Get.delete(tag: composerId); - Get.delete(tag: composerId); Get.delete(tag: composerId); Get.delete(tag: composerId); @@ -383,14 +387,12 @@ class ComposerBindings extends BaseBindings { Get.delete(tag: composerId); Get.delete(tag: composerId); Get.delete(tag: composerId); - Get.delete(tag: composerId); Get.delete(tag: composerId); Get.delete(tag: composerId); Get.delete(tag: composerId); Get.delete(tag: composerId); - Get.delete(tag: composerId); - IdentityInteractorsBindings(composerId: composerId).dispose(); + PreferencesInteractorsBindings(composerId: composerId).dispose(); } } \ No newline at end of file diff --git a/lib/features/mailbox_dashboard/data/model/composer_cache.dart b/lib/features/mailbox_dashboard/data/model/composer_cache.dart index 02516145c..afe7178ab 100644 --- a/lib/features/mailbox_dashboard/data/model/composer_cache.dart +++ b/lib/features/mailbox_dashboard/data/model/composer_cache.dart @@ -19,7 +19,7 @@ class ComposerCache with EquatableMixin { this.email, this.hasRequestReadReceipt, this.isMarkAsImportant, - this.displayMode = ScreenDisplayMode.normal + this.displayMode = ScreenDisplayMode.normal, this.composerIndex, this.composerId, }); @@ -33,7 +33,7 @@ class ComposerCache with EquatableMixin { email, hasRequestReadReceipt, isMarkAsImportant, - displayMode + displayMode, composerIndex, composerId, ]; diff --git a/lib/features/mailbox_dashboard/presentation/mailbox_dashboard_view_web.dart b/lib/features/mailbox_dashboard/presentation/mailbox_dashboard_view_web.dart index f0376ebf2..6a30400e1 100644 --- a/lib/features/mailbox_dashboard/presentation/mailbox_dashboard_view_web.dart +++ b/lib/features/mailbox_dashboard/presentation/mailbox_dashboard_view_web.dart @@ -84,7 +84,7 @@ class MailboxDashBoardView extends BaseMailboxDashBoardView { ComposeButtonWidget( imagePaths: controller.imagePaths, onTapAction: () => - controller.goToComposer(ComposerArguments()), + controller.openComposer(ComposerArguments()), ), Expanded(child: SizedBox( width: ResponsiveUtils.defaultSizeMenu, diff --git a/lib/features/manage_account/presentation/preferences/bindings/preferences_interactors_bindings.dart b/lib/features/manage_account/presentation/preferences/bindings/preferences_interactors_bindings.dart index d9cf6212f..22bab0b44 100644 --- a/lib/features/manage_account/presentation/preferences/bindings/preferences_interactors_bindings.dart +++ b/lib/features/manage_account/presentation/preferences/bindings/preferences_interactors_bindings.dart @@ -11,32 +11,60 @@ import 'package:tmail_ui_user/main/exceptions/remote_exception_thrower.dart'; class PreferencesInteractorsBindings extends InteractorsBindings { + final String? composerId; + + PreferencesInteractorsBindings({this.composerId}); + @override void bindingsDataSource() { - Get.lazyPut(() => Get.find()); + Get.lazyPut( + () => Get.find(tag: composerId), + tag: composerId, + ); } @override void bindingsDataSourceImpl() { Get.lazyPut(() => RemoteServerSettingsDataSourceImpl( - Get.find(), + Get.find(), Get.find(), - )); + ), tag: composerId); } @override void bindingsInteractor() { - Get.lazyPut(() => GetServerSettingInteractor(Get.find())); - Get.lazyPut(() => UpdateServerSettingInteractor(Get.find())); + Get.lazyPut( + () => GetServerSettingInteractor(Get.find(tag: composerId)), + tag: composerId, + ); + Get.lazyPut( + () => UpdateServerSettingInteractor(Get.find(tag: composerId)), + tag: composerId, + ); } @override void bindingsRepository() { - Get.lazyPut(() => Get.find()); + Get.lazyPut( + () => Get.find(tag: composerId), + tag: composerId, + ); } @override void bindingsRepositoryImpl() { - Get.lazyPut(() => ServerSettingsRepositoryImpl(Get.find())); + Get.lazyPut( + () => ServerSettingsRepositoryImpl(Get.find(tag: composerId)), + tag: composerId, + ); + } + + void dispose() { + Get.delete(tag: composerId); + Get.delete(tag: composerId); + Get.delete(tag: composerId); + Get.delete(tag: composerId); + Get.delete(tag: composerId); + Get.delete(tag: composerId); } } \ No newline at end of file diff --git a/test/features/composer/presentation/composer_controller_test.dart b/test/features/composer/presentation/composer_controller_test.dart index 21b3b6f1e..e3562f18b 100644 --- a/test/features/composer/presentation/composer_controller_test.dart +++ b/test/features/composer/presentation/composer_controller_test.dart @@ -419,7 +419,7 @@ void main() { mockSaveComposerCacheOnWebInteractor, mockDownloadImageAsBase64Interactor, mockTransformHtmlEmailContentInteractor, - mockGetAlwaysReadReceiptSettingInteractor, + mockGetServerSettingInteractor, mockCreateNewAndSendEmailInteractor, mockCreateNewAndSaveEmailToDraftsInteractor, mockPrintEmailInteractor, @@ -480,7 +480,7 @@ void main() { mockSaveComposerCacheOnWebInteractor, mockDownloadImageAsBase64Interactor, mockTransformHtmlEmailContentInteractor, - mockGetAlwaysReadReceiptSettingInteractor, + mockGetServerSettingInteractor, mockCreateNewAndSendEmailInteractor, mockCreateNewAndSaveEmailToDraftsInteractor, mockPrintEmailInteractor, @@ -542,7 +542,7 @@ void main() { mockSaveComposerCacheOnWebInteractor, mockDownloadImageAsBase64Interactor, mockTransformHtmlEmailContentInteractor, - mockGetAlwaysReadReceiptSettingInteractor, + mockGetServerSettingInteractor, mockCreateNewAndSendEmailInteractor, mockCreateNewAndSaveEmailToDraftsInteractor, mockPrintEmailInteractor, @@ -603,7 +603,7 @@ void main() { mockSaveComposerCacheOnWebInteractor, mockDownloadImageAsBase64Interactor, mockTransformHtmlEmailContentInteractor, - mockGetAlwaysReadReceiptSettingInteractor, + mockGetServerSettingInteractor, mockCreateNewAndSendEmailInteractor, mockCreateNewAndSaveEmailToDraftsInteractor, mockPrintEmailInteractor, @@ -905,7 +905,7 @@ void main() { mockSaveComposerCacheOnWebInteractor, mockDownloadImageAsBase64Interactor, mockTransformHtmlEmailContentInteractor, - mockGetAlwaysReadReceiptSettingInteractor, + mockGetServerSettingInteractor, mockCreateNewAndSendEmailInteractor, mockCreateNewAndSaveEmailToDraftsInteractor, mockPrintEmailInteractor, @@ -977,7 +977,7 @@ void main() { mockSaveComposerCacheOnWebInteractor, mockDownloadImageAsBase64Interactor, mockTransformHtmlEmailContentInteractor, - mockGetAlwaysReadReceiptSettingInteractor, + mockGetServerSettingInteractor, mockCreateNewAndSendEmailInteractor, mockCreateNewAndSaveEmailToDraftsInteractor, mockPrintEmailInteractor, @@ -1051,7 +1051,7 @@ void main() { mockSaveComposerCacheOnWebInteractor, mockDownloadImageAsBase64Interactor, mockTransformHtmlEmailContentInteractor, - mockGetAlwaysReadReceiptSettingInteractor, + mockGetServerSettingInteractor, mockCreateNewAndSendEmailInteractor, mockCreateNewAndSaveEmailToDraftsInteractor, mockPrintEmailInteractor, @@ -1129,7 +1129,7 @@ void main() { mockSaveComposerCacheOnWebInteractor, mockDownloadImageAsBase64Interactor, mockTransformHtmlEmailContentInteractor, - mockGetAlwaysReadReceiptSettingInteractor, + mockGetServerSettingInteractor, mockCreateNewAndSendEmailInteractor, mockCreateNewAndSaveEmailToDraftsInteractor, mockPrintEmailInteractor, @@ -1494,7 +1494,7 @@ void main() { mockSaveComposerCacheOnWebInteractor, mockDownloadImageAsBase64Interactor, mockTransformHtmlEmailContentInteractor, - mockGetAlwaysReadReceiptSettingInteractor, + mockGetServerSettingInteractor, mockCreateNewAndSendEmailInteractor, mockCreateNewAndSaveEmailToDraftsInteractor, mockPrintEmailInteractor, @@ -1546,7 +1546,7 @@ void main() { mockSaveComposerCacheOnWebInteractor, mockDownloadImageAsBase64Interactor, mockTransformHtmlEmailContentInteractor, - mockGetAlwaysReadReceiptSettingInteractor, + mockGetServerSettingInteractor, mockCreateNewAndSendEmailInteractor, mockCreateNewAndSaveEmailToDraftsInteractor, mockPrintEmailInteractor, @@ -1599,7 +1599,7 @@ void main() { mockSaveComposerCacheOnWebInteractor, mockDownloadImageAsBase64Interactor, mockTransformHtmlEmailContentInteractor, - mockGetAlwaysReadReceiptSettingInteractor, + mockGetServerSettingInteractor, mockCreateNewAndSendEmailInteractor, mockCreateNewAndSaveEmailToDraftsInteractor, mockPrintEmailInteractor, @@ -1656,7 +1656,7 @@ void main() { mockSaveComposerCacheOnWebInteractor, mockDownloadImageAsBase64Interactor, mockTransformHtmlEmailContentInteractor, - mockGetAlwaysReadReceiptSettingInteractor, + mockGetServerSettingInteractor, mockCreateNewAndSendEmailInteractor, mockCreateNewAndSaveEmailToDraftsInteractor, mockPrintEmailInteractor,