@@ -810,11 +810,9 @@ class MainViewModel @Inject constructor(
810
810
}
811
811
val uids = messages.getUids()
812
812
813
- /* threadController.updateFavoriteStatus(threadsUids, !isFavorite)
813
+ threadController.updateFavoriteStatus(threadsUids, ! isFavorite)
814
814
messageController.updateIsFavoriteStatus(uids, ! isFavorite)
815
815
816
- val isSuccess = if (isFavorite) {
817
- ApiRepository.removeFromFavorites(mailbox.uuid, uids).isSuccess()*/
818
816
val apiResponses = if (isFavorite) {
819
817
ApiRepository .removeFromFavorites(mailbox.uuid, uids)
820
818
} else {
@@ -874,6 +872,8 @@ class MainViewModel @Inject constructor(
874
872
875
873
val messages = getMessagesToSpamOrHam(threads, message)
876
874
875
+ threadController.updateIsMovedOutLocally(threadsUids, hasBeenMovedOut = true )
876
+
877
877
val apiResponses = ApiRepository .moveMessages(mailbox.uuid, messages.getUids(), destinationFolder.id)
878
878
879
879
if (apiResponses.atLeastOneSucceeded()) {
@@ -883,6 +883,8 @@ class MainViewModel @Inject constructor(
883
883
destinationFolderId = destinationFolder.id,
884
884
callbacks = RefreshCallbacks (::onDownloadStart, ::onDownloadStop),
885
885
)
886
+ } else {
887
+ threadController.updateIsMovedOutLocally(threadsUids, hasBeenMovedOut = false )
886
888
}
887
889
888
890
if (displaySnackbar) showMoveSnackbar(threads, message, messages, apiResponses, destinationFolder)
0 commit comments