Add show/hide ip persistency

This commit is contained in:
Alfonso Grillo
2022-11-02 17:51:26 +01:00
parent 2045dfdaa0
commit e6e7e7c5d4
4 changed files with 14 additions and 9 deletions
@@ -96,7 +96,7 @@ struct UserSessionsOverview: View {
viewModel.send(viewAction: .verifyCurrentSession)
}, onViewDetailsAction: { _ in
viewModel.send(viewAction: .viewCurrentSessionDetails)
}, showLocationInformations: viewModel.showLocationInfo)
}, showLocationInformations: viewModel.viewState.showLocationInfo)
} header: {
HStack(alignment: .firstTextBaseline) {
Text(VectorL10n.userSessionsOverviewCurrentSessionSectionTitle)
@@ -143,9 +143,9 @@ struct UserSessionsOverview: View {
private var otherSessionsMenu: some View {
Menu {
Button {
viewModel.showLocationInfo.toggle()
viewModel.send(viewAction: .showLocationInfo)
} label: {
Label(showLocationInfo: viewModel.showLocationInfo)
Label(showLocationInfo: viewModel.viewState.showLocationInfo)
}
signOutButton
@@ -166,7 +166,7 @@ struct UserSessionsOverview: View {
LazyVStack(spacing: 0) {
ForEach(viewModel.viewState.otherSessionsViewData.prefix(maxOtherSessionsToDisplay)) { viewData in
UserSessionListItem(viewData: viewData,
showsLocationInfo: viewModel.showLocationInfo,
showsLocationInfo: viewModel.viewState.showLocationInfo,
isSeparatorHidden: viewData == viewModel.viewState.otherSessionsViewData.last,
onBackgroundTap: { sessionId in viewModel.send(viewAction: .tapUserSession(sessionId)) })
}