TF-4227 Hide the "Loading More" button when there are no more emails to load.

This commit is contained in:
dab246
2026-01-07 11:07:51 +07:00
committed by Dat H. Pham
parent 3d03c8475b
commit ca35924a5f
@@ -800,7 +800,7 @@ class ThreadController extends BaseController with EmailActionController {
filter: getFilterConditionForLoadMailbox(oldestEmail: oldestEmail), filter: getFilterConditionForLoadMailbox(oldestEmail: oldestEmail),
properties: EmailUtils.getPropertiesForEmailGetMethod(_session!, _accountId!), properties: EmailUtils.getPropertiesForEmailGetMethod(_session!, _accountId!),
lastEmailId: oldestEmail?.id, lastEmailId: oldestEmail?.id,
useCache: selectedMailbox?.isVirtualFolder != true, useCache: selectedMailbox?.isCacheable ?? false,
) )
)); ));
} }
@@ -822,13 +822,13 @@ class ThreadController extends BaseController with EmailActionController {
} }
void _loadMoreEmailsSuccess(LoadMoreEmailsSuccess success) { void _loadMoreEmailsSuccess(LoadMoreEmailsSuccess success) {
canLoadMore = success.emailList.isNotEmpty;
loadingMoreStatus.value = LoadingMoreStatus.completed; loadingMoreStatus.value = LoadingMoreStatus.completed;
final appendableList = validateListEmailsLoadMore(success.emailList); final appendableList = validateListEmailsLoadMore(success.emailList);
log('ThreadController::_loadMoreEmailsSuccess: emailList = ${success.emailList.length} | appendableList = ${appendableList.length}'); log('ThreadController::_loadMoreEmailsSuccess: emailList = ${success.emailList.length} | appendableList = ${appendableList.length}');
if (appendableList.isNotEmpty) { if (appendableList.isNotEmpty) {
mailboxDashBoardController.emailsInCurrentMailbox.addAll(appendableList); mailboxDashBoardController.emailsInCurrentMailbox.addAll(appendableList);
} }
canLoadMore = success.emailList.isNotEmpty && appendableList.isNotEmpty;
if (PlatformInfo.isWeb) { if (PlatformInfo.isWeb) {
_validateBrowserHeight(); _validateBrowserHeight();
} }