pull/35/head^2
kunfei 5 years ago
parent 63c1b8914e
commit 8a543ef3b7
  1. 2
      app/src/main/java/io/legado/app/ui/replacerule/edit/ReplaceEditDialog.kt
  2. 2
      app/src/main/java/io/legado/app/ui/replacerule/edit/ReplaceEditViewModel.kt

@ -25,7 +25,7 @@ class ReplaceEditDialog : DialogFragment(),
val dialog = ReplaceEditDialog() val dialog = ReplaceEditDialog()
id?.let { id?.let {
val bundle = Bundle() val bundle = Bundle()
bundle.putLong("data", id) bundle.putLong("id", id)
dialog.arguments = bundle dialog.arguments = bundle
} }
return dialog return dialog

@ -14,7 +14,7 @@ class ReplaceEditViewModel(application: Application) : BaseViewModel(application
fun initData(bundle: Bundle) { fun initData(bundle: Bundle) {
execute { execute {
replaceRuleData.value ?: let { replaceRuleData.value ?: let {
val id = bundle.getLong("data") val id = bundle.getLong("id")
if (id > 0) { if (id > 0) {
App.db.replaceRuleDao().findById(id)?.let { App.db.replaceRuleDao().findById(id)?.let {
replaceRuleData.postValue(it) replaceRuleData.postValue(it)

Loading…
Cancel
Save