@ -38,7 +38,7 @@ class ReadRssActivity : VMBaseActivity<ReadRssViewModel>(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)
@ -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()