TF-3396 Fix mobile app can not get the latest email when open app from terminated
This commit is contained in:
+7
@@ -253,6 +253,7 @@ class MailboxDashBoardController extends ReloadableController
|
|||||||
StreamSubscription? _pendingSharedFileInfoSubscription;
|
StreamSubscription? _pendingSharedFileInfoSubscription;
|
||||||
StreamSubscription? _receivingFileSharingStreamSubscription;
|
StreamSubscription? _receivingFileSharingStreamSubscription;
|
||||||
StreamSubscription? _currentEmailIdInNotificationIOSStreamSubscription;
|
StreamSubscription? _currentEmailIdInNotificationIOSStreamSubscription;
|
||||||
|
bool _isFirstSessionLoad = false;
|
||||||
|
|
||||||
final StreamController<Either<Failure, Success>> _progressStateController =
|
final StreamController<Either<Failure, Success>> _progressStateController =
|
||||||
StreamController<Either<Failure, Success>>.broadcast();
|
StreamController<Either<Failure, Success>>.broadcast();
|
||||||
@@ -264,6 +265,10 @@ class MailboxDashBoardController extends ReloadableController
|
|||||||
final _notificationManager = LocalNotificationManager.instance;
|
final _notificationManager = LocalNotificationManager.instance;
|
||||||
final _fcmService = FcmService.instance;
|
final _fcmService = FcmService.instance;
|
||||||
|
|
||||||
|
bool get isFirstSessionLoad => _isFirstSessionLoad;
|
||||||
|
|
||||||
|
bool setIsFirstSessionLoad(bool value) => _isFirstSessionLoad = value;
|
||||||
|
|
||||||
MailboxDashBoardController(
|
MailboxDashBoardController(
|
||||||
this._moveToMailboxInteractor,
|
this._moveToMailboxInteractor,
|
||||||
this._deleteEmailPermanentlyInteractor,
|
this._deleteEmailPermanentlyInteractor,
|
||||||
@@ -645,6 +650,7 @@ class MailboxDashBoardController extends ReloadableController
|
|||||||
|
|
||||||
void _setUpComponentsFromSession(Session session) {
|
void _setUpComponentsFromSession(Session session) {
|
||||||
final currentAccountId = session.accountId;
|
final currentAccountId = session.accountId;
|
||||||
|
_isFirstSessionLoad = true;
|
||||||
sessionCurrent = session;
|
sessionCurrent = session;
|
||||||
accountId.value = currentAccountId;
|
accountId.value = currentAccountId;
|
||||||
|
|
||||||
@@ -3140,6 +3146,7 @@ class MailboxDashBoardController extends ReloadableController
|
|||||||
mapDefaultMailboxIdByRole = {};
|
mapDefaultMailboxIdByRole = {};
|
||||||
WebSocketController.instance.onClose();
|
WebSocketController.instance.onClose();
|
||||||
_currentEmailState = null;
|
_currentEmailState = null;
|
||||||
|
_isFirstSessionLoad = false;
|
||||||
super.onClose();
|
super.onClose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -261,7 +261,10 @@ class ThreadController extends BaseController with EmailActionController {
|
|||||||
_currentMemoryMailboxId = mailbox.id;
|
_currentMemoryMailboxId = mailbox.id;
|
||||||
consumeState(Stream.value(Right(GetAllEmailLoading())));
|
consumeState(Stream.value(Right(GetAllEmailLoading())));
|
||||||
_resetToOriginalValue();
|
_resetToOriginalValue();
|
||||||
_getAllEmailAction(getLatestChanges: false);
|
_getAllEmailAction(
|
||||||
|
getLatestChanges: mailboxDashBoardController.isFirstSessionLoad,
|
||||||
|
);
|
||||||
|
mailboxDashBoardController.setIsFirstSessionLoad(false);
|
||||||
} else if (mailbox == null) { // disable current mailbox when search active
|
} else if (mailbox == null) { // disable current mailbox when search active
|
||||||
_currentMemoryMailboxId = null;
|
_currentMemoryMailboxId = null;
|
||||||
_resetToOriginalValue();
|
_resetToOriginalValue();
|
||||||
@@ -520,7 +523,7 @@ class ThreadController extends BaseController with EmailActionController {
|
|||||||
void _getAllEmailAction({
|
void _getAllEmailAction({
|
||||||
bool getLatestChanges = true,
|
bool getLatestChanges = true,
|
||||||
}) {
|
}) {
|
||||||
log('ThreadController::_getAllEmailAction:');
|
log('ThreadController::_getAllEmailAction:getLatestChanges = $getLatestChanges');
|
||||||
if (_session != null &&_accountId != null) {
|
if (_session != null &&_accountId != null) {
|
||||||
consumeState(_getEmailsInMailboxInteractor.execute(
|
consumeState(_getEmailsInMailboxInteractor.execute(
|
||||||
_session!,
|
_session!,
|
||||||
|
|||||||
Reference in New Issue
Block a user