diff --git a/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleViewModel.kt b/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleViewModel.kt index 5c5f0e6a5..540900eec 100644 --- a/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleViewModel.kt +++ b/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.help.FileHelp 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.splitNotBlank import org.jetbrains.anko.toast @@ -17,7 +18,7 @@ class ReplaceRuleViewModel(application: Application) : BaseViewModel(application fun importSource(text: String, toast: (msg: String) -> Unit) { execute { - + Restore.importOldReplaceRule(text) }.onError { toast(it.localizedMessage ?: "ERROR") }.onSuccess {