Merge pull request #7794 from vector-im/feature/ons/fix_current_session_ip_address_visibility

Fix current session ip address visibility (PSG-1109)
This commit is contained in:
Onuray Sahin 2022-12-19 16:33:18 +03:00 committed by GitHub
commit f08a3f7966
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 4 deletions

1
changelog.d/7794.bugfix Normal file
View file

@ -0,0 +1 @@
Fix current session ip address visibility

View file

@ -75,7 +75,7 @@ class SessionInfoView @JvmOverloads constructor(
renderDeviceLastSeenDetails( renderDeviceLastSeenDetails(
sessionInfoViewState.deviceFullInfo.isInactive, sessionInfoViewState.deviceFullInfo.isInactive,
sessionInfoViewState.deviceFullInfo.deviceInfo, sessionInfoViewState.deviceFullInfo.deviceInfo,
sessionInfoViewState.isLastSeenDetailsVisible, sessionInfoViewState.isLastActivityVisible,
sessionInfoViewState.isShowingIpAddress, sessionInfoViewState.isShowingIpAddress,
dateFormatter, dateFormatter,
drawableProvider, drawableProvider,
@ -197,7 +197,7 @@ class SessionInfoView @JvmOverloads constructor(
} else { } else {
views.sessionInfoLastActivityTextView.isGone = true views.sessionInfoLastActivityTextView.isGone = true
} }
views.sessionInfoLastIPAddressTextView.setTextOrHide(deviceInfo.lastSeenIp?.takeIf { isLastSeenDetailsVisible && isShowingIpAddress }) views.sessionInfoLastIPAddressTextView.setTextOrHide(deviceInfo.lastSeenIp?.takeIf { isShowingIpAddress })
} }
private fun renderDetailsButton(isDetailsButtonVisible: Boolean) { private fun renderDetailsButton(isDetailsButtonVisible: Boolean) {

View file

@ -24,6 +24,6 @@ data class SessionInfoViewState(
val isVerifyButtonVisible: Boolean = true, val isVerifyButtonVisible: Boolean = true,
val isDetailsButtonVisible: Boolean = true, val isDetailsButtonVisible: Boolean = true,
val isLearnMoreLinkVisible: Boolean = false, val isLearnMoreLinkVisible: Boolean = false,
val isLastSeenDetailsVisible: Boolean = false, val isLastActivityVisible: Boolean = false,
val isShowingIpAddress: Boolean = false, val isShowingIpAddress: Boolean = false,
) )

View file

@ -224,7 +224,7 @@ class SessionOverviewFragment :
isVerifyButtonVisible = isCurrentSession || viewState.isCurrentSessionTrusted, isVerifyButtonVisible = isCurrentSession || viewState.isCurrentSessionTrusted,
isDetailsButtonVisible = false, isDetailsButtonVisible = false,
isLearnMoreLinkVisible = deviceInfo.roomEncryptionTrustLevel != RoomEncryptionTrustLevel.Default, isLearnMoreLinkVisible = deviceInfo.roomEncryptionTrustLevel != RoomEncryptionTrustLevel.Default,
isLastSeenDetailsVisible = !isCurrentSession, isLastActivityVisible = !isCurrentSession,
isShowingIpAddress = viewState.isShowingIpAddress, isShowingIpAddress = viewState.isShowingIpAddress,
) )
views.sessionOverviewInfo.render(infoViewState, dateFormatter, drawableProvider, colorProvider, stringProvider) views.sessionOverviewInfo.render(infoViewState, dateFormatter, drawableProvider, colorProvider, stringProvider)