@@ -290,8 +290,8 @@ class VectorSettingsDevicesFragment :
290
290
val unverifiedSessionsCount = deviceFullInfoList?.unverifiedSessionsCount ? : 0
291
291
292
292
renderSecurityRecommendations(inactiveSessionsCount, unverifiedSessionsCount)
293
- renderCurrentSessionView(currentDeviceInfo, hasOtherDevices = otherDevices?.isNotEmpty().orFalse())
294
- renderOtherSessionsView(otherDevices, state.isShowingIpAddress )
293
+ renderCurrentSessionView(currentDeviceInfo, hasOtherDevices = otherDevices?.isNotEmpty().orFalse(), state )
294
+ renderOtherSessionsView(otherDevices, state)
295
295
} else {
296
296
hideSecurityRecommendations()
297
297
hideCurrentSessionView()
@@ -347,13 +347,16 @@ class VectorSettingsDevicesFragment :
347
347
hideInactiveSessionsRecommendation()
348
348
}
349
349
350
- private fun renderOtherSessionsView (otherDevices : List <DeviceFullInfo >? , isShowingIpAddress : Boolean ) {
350
+ private fun renderOtherSessionsView (otherDevices : List <DeviceFullInfo >? , state : DevicesViewState ) {
351
+ val isShowingIpAddress = state.isShowingIpAddress
351
352
if (otherDevices.isNullOrEmpty()) {
352
353
hideOtherSessionsView()
353
354
} else {
354
355
views.deviceListHeaderOtherSessions.isVisible = true
355
356
val colorDestructive = colorProvider.getColorFromAttribute(R .attr.colorError)
356
357
val multiSignoutItem = views.deviceListHeaderOtherSessions.menu.findItem(R .id.otherSessionsHeaderMultiSignout)
358
+ // Hide multi signout if we have an external account manager
359
+ multiSignoutItem.isVisible = state.externalAccountManagementUrl == null
357
360
val nbDevices = otherDevices.size
358
361
multiSignoutItem.title = stringProvider.getQuantityString(R .plurals.device_manager_other_sessions_multi_signout_all, nbDevices, nbDevices)
359
362
multiSignoutItem.setTextColor(colorDestructive)
@@ -377,23 +380,24 @@ class VectorSettingsDevicesFragment :
377
380
views.deviceListOtherSessions.isVisible = false
378
381
}
379
382
380
- private fun renderCurrentSessionView (currentDeviceInfo : DeviceFullInfo ? , hasOtherDevices : Boolean ) {
383
+ private fun renderCurrentSessionView (currentDeviceInfo : DeviceFullInfo ? , hasOtherDevices : Boolean , state : DevicesViewState ) {
381
384
currentDeviceInfo?.let {
382
- renderCurrentSessionHeaderView(hasOtherDevices)
385
+ renderCurrentSessionHeaderView(hasOtherDevices, state )
383
386
renderCurrentSessionListView(it)
384
387
} ? : run {
385
388
hideCurrentSessionView()
386
389
}
387
390
}
388
391
389
- private fun renderCurrentSessionHeaderView (hasOtherDevices : Boolean ) {
392
+ private fun renderCurrentSessionHeaderView (hasOtherDevices : Boolean , state : DevicesViewState ) {
390
393
views.deviceListHeaderCurrentSession.isVisible = true
391
394
val colorDestructive = colorProvider.getColorFromAttribute(R .attr.colorError)
392
395
val signoutSessionItem = views.deviceListHeaderCurrentSession.menu.findItem(R .id.currentSessionHeaderSignout)
393
396
signoutSessionItem.setTextColor(colorDestructive)
394
397
val signoutOtherSessionsItem = views.deviceListHeaderCurrentSession.menu.findItem(R .id.currentSessionHeaderSignoutOtherSessions)
395
398
signoutOtherSessionsItem.setTextColor(colorDestructive)
396
- signoutOtherSessionsItem.isVisible = hasOtherDevices
399
+ // Hide signout other sessions if we have an external account manager
400
+ signoutOtherSessionsItem.isVisible = hasOtherDevices && state.externalAccountManagementUrl == null
397
401
}
398
402
399
403
private fun renderCurrentSessionListView (currentDeviceInfo : DeviceFullInfo ) {
0 commit comments