diff --git a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt index cef3e5361..8c8e0b5a2 100644 --- a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt @@ -38,7 +38,7 @@ class ReadRssActivity : VMBaseActivity(R.layout.activity_rss_r when (item.itemId) { R.id.menu_rss_star -> viewModel.rssArticleLiveData.value?.let { it.star = !it.star - viewModel.upRssArticle(it) + viewModel.upRssArticle(it) { upStarMenu() } } } return super.onCompatOptionsItemSelected(item) diff --git a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt index 0e063d42b..a8c0d2963 100644 --- a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt @@ -67,9 +67,11 @@ class ReadRssViewModel(application: Application) : BaseViewModel(application) { } } - fun upRssArticle(rssArticle: RssArticle) { + fun upRssArticle(rssArticle: RssArticle, success: () -> Unit) { execute { App.db.rssArticleDao().update(rssArticle) + }.onSuccess { + success() } } } \ No newline at end of file