pull/49/head
kunfei 5 years ago
parent 2adf73e9dc
commit 30bc951dd5
  1. 8
      app/src/main/java/io/legado/app/base/BaseViewModel.kt
  2. 2
      app/src/main/java/io/legado/app/service/AudioPlayService.kt
  3. 2
      app/src/main/java/io/legado/app/web/utils/ReturnData.kt

@ -45,9 +45,9 @@ open class BaseViewModel(application: Application) : AndroidViewModel(applicatio
} }
} }
open fun toast(message: CharSequence) { open fun toast(message: CharSequence?) {
launch { launch {
context.toast(message) context.toast(message ?: toString())
} }
} }
@ -57,9 +57,9 @@ open class BaseViewModel(application: Application) : AndroidViewModel(applicatio
} }
} }
open fun longToast(message: CharSequence) { open fun longToast(message: CharSequence?) {
launch { launch {
context.toast(message) context.toast(message ?: toString())
} }
} }
} }

@ -266,7 +266,7 @@ class AudioPlayService : BaseService(),
removeLoading(chapter.index) removeLoading(chapter.index)
} }
}?.onError { }?.onError {
contentLoadFinish(chapter, it.localizedMessage) contentLoadFinish(chapter, it.localizedMessage ?: toString())
removeLoading(chapter.index) removeLoading(chapter.index)
} }
} }

@ -20,7 +20,7 @@ class ReturnData {
return errorMsg return errorMsg
} }
fun setErrorMsg(errorMsg: String): ReturnData { fun setErrorMsg(errorMsg: String?): ReturnData {
this.isSuccess = false this.isSuccess = false
this.errorMsg = errorMsg this.errorMsg = errorMsg
return this return this

Loading…
Cancel
Save