forked from shihaam/thijooree
fixes for bml contact addd drop down and loading contacts
This commit is contained in:
@@ -98,10 +98,13 @@ class AddContactSheetFragment : BottomSheetDialogFragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
val store = CredentialStore(requireContext())
|
val store = CredentialStore(requireContext())
|
||||||
for ((loginId, _) in app.bmlSessions) {
|
for ((loginId, profiles) in app.bmlProfilesMap) {
|
||||||
val ownerName = store.loadBmlUserProfile(loginId)?.fullName?.takeIf { it.isNotBlank() } ?: loginId
|
val fullName = store.loadBmlUserProfile(loginId)?.fullName?.takeIf { it.isNotBlank() }
|
||||||
val profileName = app.bmlAccounts.firstOrNull { it.loginTag == "bml_$loginId" }?.profileName ?: ""
|
for (profile in profiles) {
|
||||||
list.add(DestinationOption("BML · $ownerName", isBml = true, bmlLoginId = loginId, subtitle = profileName))
|
if (app.bmlSessions.containsKey(profile.profileId)) {
|
||||||
|
list.add(DestinationOption("BML · ${fullName ?: profile.name}", isBml = true, bmlLoginId = profile.profileId, subtitle = profile.name))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return list
|
return list
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -509,6 +509,8 @@ fun applyNavLabelVisibility() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (savedProfiles.isNotEmpty()) app.bmlProfilesMap[loginId] = savedProfiles
|
||||||
|
|
||||||
// Also try legacy single-profile session token (pre-multi-profile installs)
|
// Also try legacy single-profile session token (pre-multi-profile installs)
|
||||||
if (savedProfiles.isEmpty()) {
|
if (savedProfiles.isEmpty()) {
|
||||||
val legacyToken = store.loadBmlSession(loginId)
|
val legacyToken = store.loadBmlSession(loginId)
|
||||||
|
|||||||
Reference in New Issue
Block a user