Skip to content
Snippets Groups Projects
Commit 3a93f9f2 authored by Duncan McNamara's avatar Duncan McNamara Committed by Nicolas Pomepuy
Browse files

SubDownload: fix err msg staying at first launch

When starting the dialog for the first time in the app's lifecycle, the
coroutine started search will fail, before succeeding. Because of this,
the errror message is displayed, but never removed once search has been
successful, causing an overlap of the different views. This is fixed by
resetting errorObservable and messageObservable.
parent 1516c587
No related branches found
No related tags found
1 merge request!1263SubtitleDownloader UI fixes
......@@ -167,7 +167,12 @@ class SubtitlesModel(private val context: Context, private val mediaUri: Uri, pr
} ?: listOf()
}
if (isActive) apiResultLiveData.postValue(subs)
if (subs.isEmpty()) observableMessage.set(context.getString(R.string.no_result))
if (subs.isEmpty()) {
observableMessage.set(context.getString(R.string.no_result))
} else {
observableMessage.set("")
}
observableError.set(false)
} catch (e: Exception) {
Log.e("SubtitlesModel", e.message, e)
observableError.set(true)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment