mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 02:15:35 +03:00
Fixing security section recommendation visibility
This commit is contained in:
parent
cf25b81e9a
commit
81038bdd23
1 changed files with 5 additions and 3 deletions
|
@ -186,14 +186,16 @@ class VectorSettingsDevicesFragment :
|
||||||
unverifiedSessionsCount: Int,
|
unverifiedSessionsCount: Int,
|
||||||
isCurrentSessionVerified: Boolean,
|
isCurrentSessionVerified: Boolean,
|
||||||
) {
|
) {
|
||||||
if (unverifiedSessionsCount == 0 && inactiveSessionsCount == 0) {
|
val isUnverifiedSectionVisible = unverifiedSessionsCount > 0 && isCurrentSessionVerified
|
||||||
|
val isInactiveSectionVisible = inactiveSessionsCount > 0
|
||||||
|
if (isUnverifiedSectionVisible.not() && isInactiveSectionVisible.not()) {
|
||||||
hideSecurityRecommendations()
|
hideSecurityRecommendations()
|
||||||
} else {
|
} else {
|
||||||
views.deviceListHeaderSectionSecurityRecommendations.isVisible = true
|
views.deviceListHeaderSectionSecurityRecommendations.isVisible = true
|
||||||
views.deviceListSecurityRecommendationsDivider.isVisible = true
|
views.deviceListSecurityRecommendationsDivider.isVisible = true
|
||||||
|
|
||||||
views.deviceListUnverifiedSessionsRecommendation.isVisible = unverifiedSessionsCount > 0 && isCurrentSessionVerified
|
views.deviceListUnverifiedSessionsRecommendation.isVisible = isUnverifiedSectionVisible
|
||||||
views.deviceListInactiveSessionsRecommendation.isVisible = inactiveSessionsCount > 0
|
views.deviceListInactiveSessionsRecommendation.isVisible = isInactiveSectionVisible
|
||||||
val unverifiedSessionsViewState = SecurityRecommendationViewState(
|
val unverifiedSessionsViewState = SecurityRecommendationViewState(
|
||||||
description = getString(R.string.device_manager_unverified_sessions_description),
|
description = getString(R.string.device_manager_unverified_sessions_description),
|
||||||
sessionsCount = unverifiedSessionsCount,
|
sessionsCount = unverifiedSessionsCount,
|
||||||
|
|
Loading…
Reference in a new issue