From 4e4b072c1633a81e4784c9224481300385ea0ad5 Mon Sep 17 00:00:00 2001 From: tarsin Date: Wed, 5 Jul 2023 11:01:35 +0800 Subject: [PATCH] No more UIContext needed to modifyFav --- .../main/java/com/hippo/ehviewer/ui/CommonOperations.kt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/hippo/ehviewer/ui/CommonOperations.kt b/app/src/main/java/com/hippo/ehviewer/ui/CommonOperations.kt index 34fad5cb0..ab41aa2db 100644 --- a/app/src/main/java/com/hippo/ehviewer/ui/CommonOperations.kt +++ b/app/src/main/java/com/hippo/ehviewer/ui/CommonOperations.kt @@ -254,17 +254,13 @@ private suspend fun doAddToFavorites( if (slot != LOCAL_FAVORITED || galleryInfo.favoriteSlot == NOT_FAVORITED) { galleryInfo.favoriteSlot = slot galleryInfo.favoriteName = Settings.favCat.getOrNull(slot) - withUIContext { - FavouriteStatusRouter.modifyFavourites(galleryInfo.gid, slot) - } + FavouriteStatusRouter.modifyFavourites(galleryInfo.gid, slot) } } else if (slot != LOCAL_FAVORITED || galleryInfo.favoriteSlot == LOCAL_FAVORITED) { val newSlot = if (galleryInfo.favoriteSlot > LOCAL_FAVORITED && localFavorited) LOCAL_FAVORITED else NOT_FAVORITED galleryInfo.favoriteSlot = newSlot galleryInfo.favoriteName = null - withUIContext { - FavouriteStatusRouter.modifyFavourites(galleryInfo.gid, newSlot) - } + FavouriteStatusRouter.modifyFavourites(galleryInfo.gid, newSlot) } return add }