Improved account spinner launched effect
This commit is contained in:
@@ -1024,16 +1024,22 @@ private fun AccountSpinner(ctx: Context, viewModel: ViewModel, navController: Na
|
|||||||
|
|
||||||
var expanded by rememberSaveable { mutableStateOf(false) }
|
var expanded by rememberSaveable { mutableStateOf(false) }
|
||||||
val selected: String by viewModel.selectedAor.collectAsState()
|
val selected: String by viewModel.selectedAor.collectAsState()
|
||||||
|
val uasValue by uas
|
||||||
|
|
||||||
if (uas.value.isEmpty())
|
LaunchedEffect(uasValue, selected) {
|
||||||
viewModel.updateSelectedAor("")
|
if (uasValue.isEmpty()) {
|
||||||
else
|
if (selected != "") viewModel.updateSelectedAor("")
|
||||||
|
} else {
|
||||||
if (selected == "" || UserAgent.ofAor(selected) == null) {
|
if (selected == "" || UserAgent.ofAor(selected) == null) {
|
||||||
viewModel.updateSelectedAor(uas.value.first().account.aor)
|
viewModel.updateSelectedAor(uasValue.first().account.aor)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
showCall(ctx, viewModel, UserAgent.ofAor(selected))
|
val ua = UserAgent.ofAor(selected)
|
||||||
|
if (ua != null) {
|
||||||
|
showCall(ctx, viewModel, ua)
|
||||||
viewModel.triggerAccountUpdate()
|
viewModel.triggerAccountUpdate()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (selected == "") {
|
if (selected == "") {
|
||||||
OutlinedButton(
|
OutlinedButton(
|
||||||
|
|||||||
Reference in New Issue
Block a user