pull/1395/head
gedoor 3 years ago
parent 3948bb42fd
commit 6b554a3910
  1. 5
      app/src/main/java/io/legado/app/ui/login/SourceLoginDialog.kt

@ -23,7 +23,6 @@ import kotlinx.coroutines.Dispatchers.IO
import kotlinx.coroutines.Dispatchers.Main import kotlinx.coroutines.Dispatchers.Main
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
import splitties.init.appCtx
import splitties.views.onClick import splitties.views.onClick
class SourceLoginDialog : BaseDialogFragment(R.layout.dialog_login) { class SourceLoginDialog : BaseDialogFragment(R.layout.dialog_login) {
@ -117,13 +116,13 @@ class SourceLoginDialog : BaseDialogFragment(R.layout.dialog_login) {
source.getLoginJs()?.let { source.getLoginJs()?.let {
try { try {
source.evalJS(it) source.evalJS(it)
appCtx.toastOnUi(R.string.success) context?.toastOnUi(R.string.success)
withContext(Main) { withContext(Main) {
dismiss() dismiss()
} }
} catch (e: Exception) { } catch (e: Exception) {
AppLog.put("登录出错\n${e.localizedMessage}", e) AppLog.put("登录出错\n${e.localizedMessage}", e)
appCtx.toastOnUi("error:${e.localizedMessage}") context?.toastOnUi("error:${e.localizedMessage}")
e.printOnDebug() e.printOnDebug()
} }
} }

Loading…
Cancel
Save