Cleaning.

This commit is contained in:
aminecmi
2022-10-29 20:50:44 +02:00
parent 6076eb1cee
commit 5494978db8
8 changed files with 80 additions and 104 deletions

View File

@ -94,7 +94,7 @@ class AddSourceActivity : AppCompatActivity(), DIAware {
CoroutineScope(Dispatchers.Main).launch {
try {
val items = repository.getSpouts()
if (items != null) {
if (items.isNotEmpty()) {
val itemsStrings = items.map { it.value.name }
for ((key, value) in items) {
spoutsKV[value.name] = key

View File

@ -101,7 +101,7 @@ class LoginActivity : AppCompatActivity(), DIAware {
finish()
}
private fun preferenceError(t: Throwable) {
private fun preferenceError() {
appSettingsService.resetLoginInformation()
binding.urlView.error = getString(R.string.wrong_infos)
@ -169,7 +169,7 @@ class LoginActivity : AppCompatActivity(), DIAware {
goToMain()
} else {
CoroutineScope(Dispatchers.Main).launch {
preferenceError(Exception("Not success"))
preferenceError()
}
}
}

View File

@ -56,7 +56,7 @@ class SourcesActivity : AppCompatActivity(), DIAware {
CoroutineScope(Dispatchers.Main).launch {
val response = repository.getSources()
if (response != null) {
if (response.isNotEmpty()) {
items = response
val mAdapter = SourcesListAdapter(
this@SourcesActivity, items