|
|
@ -16,11 +16,11 @@ class HttpTtsEditViewModel(app: Application) : BaseViewModel(app) { |
|
|
|
fun initData(arguments: Bundle?, success: (httpTTS: HttpTTS) -> Unit) { |
|
|
|
fun initData(arguments: Bundle?, success: (httpTTS: HttpTTS) -> Unit) { |
|
|
|
execute { |
|
|
|
execute { |
|
|
|
if (id == null) { |
|
|
|
if (id == null) { |
|
|
|
id = arguments?.getLong("id") |
|
|
|
val argumentId = arguments?.getLong("id") |
|
|
|
val httpTTS = id?.let { |
|
|
|
if (argumentId != null && argumentId != 0L) { |
|
|
|
return@let appDb.httpTTSDao.get(it) |
|
|
|
id = argumentId |
|
|
|
|
|
|
|
return@execute appDb.httpTTSDao.get(argumentId) |
|
|
|
} |
|
|
|
} |
|
|
|
return@execute httpTTS |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return@execute null |
|
|
|
return@execute null |
|
|
|
}.onSuccess { |
|
|
|
}.onSuccess { |
|
|
|