mirror of
https://gitlab.com/ultrasonic/ultrasonic.git
synced 2025-04-26 21:52:16 +03:00
Updated missing index handling
This commit is contained in:
parent
02716c827a
commit
db4f8b83d3
@ -85,8 +85,10 @@ internal class ServerRowAdapter(
|
|||||||
text?.text = context.getString(R.string.main_offline)
|
text?.text = context.getString(R.string.main_offline)
|
||||||
description?.text = ""
|
description?.text = ""
|
||||||
} else {
|
} else {
|
||||||
text?.text = data.singleOrNull { setting -> setting.index == index }?.name ?: ""
|
val setting = data.singleOrNull { t -> t.index == index }
|
||||||
description?.text = data.singleOrNull { setting -> setting.index == index }?.url ?: ""
|
text?.text = setting?.name ?: ""
|
||||||
|
description?.text = setting?.url ?: ""
|
||||||
|
if (setting == null) serverMenu?.visibility = View.INVISIBLE
|
||||||
}
|
}
|
||||||
|
|
||||||
// Provide icons for the row
|
// Provide icons for the row
|
||||||
|
@ -75,7 +75,7 @@ class ActiveServerProvider(
|
|||||||
}
|
}
|
||||||
|
|
||||||
GlobalScope.launch(Dispatchers.IO) {
|
GlobalScope.launch(Dispatchers.IO) {
|
||||||
val serverId = repository.findByIndex(index)!!.id
|
val serverId = repository.findByIndex(index)?.id ?: 0
|
||||||
setActiveServerId(context, serverId)
|
setActiveServerId(context, serverId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user