pull/69/head
kunfei 5 years ago
parent 059433320f
commit 454e5395ee
  1. 3
      app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleViewModel.kt

@ -8,6 +8,7 @@ import io.legado.app.base.BaseViewModel
import io.legado.app.data.entities.ReplaceRule import io.legado.app.data.entities.ReplaceRule
import io.legado.app.help.FileHelp import io.legado.app.help.FileHelp
import io.legado.app.help.storage.Backup import io.legado.app.help.storage.Backup
import io.legado.app.help.storage.Restore
import io.legado.app.utils.GSON import io.legado.app.utils.GSON
import io.legado.app.utils.splitNotBlank import io.legado.app.utils.splitNotBlank
import org.jetbrains.anko.toast import org.jetbrains.anko.toast
@ -17,7 +18,7 @@ class ReplaceRuleViewModel(application: Application) : BaseViewModel(application
fun importSource(text: String, toast: (msg: String) -> Unit) { fun importSource(text: String, toast: (msg: String) -> Unit) {
execute { execute {
Restore.importOldReplaceRule(text)
}.onError { }.onError {
toast(it.localizedMessage ?: "ERROR") toast(it.localizedMessage ?: "ERROR")
}.onSuccess { }.onSuccess {

Loading…
Cancel
Save