-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hide connection details view based on tunnel status #7534
Hide connection details view based on tunnel status #7534
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion
ios/MullvadVPN/View controllers/Tunnel/ConnectionView/ConnectionView.swift
line 41 at r1 (raw file):
.cornerRadius(12) .padding(EdgeInsets(top: 16, leading: 16, bottom: 24, trailing: 16)) .onReceive(connectionViewModel.$tunnelStatus) { _ in
The onReceive
block was being triggered before the view model had a chance to update the tunnelState
property with the new value. This caused computed properties to work with outdated or incorrect values, leading to a timing issue. By marking showsConnectionDetails
as @Published
, we ensure that SwiftUI properly observes the value updates and works with the correct, synchronized state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 3 files at r1, all commit messages.
Reviewable status: 2 of 3 files reviewed, 1 unresolved discussion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved
b2bcc8d
to
3aaafb0
Compare
🚨 End to end tests failed. Please check the failed workflow run. |
1 similar comment
🚨 End to end tests failed. Please check the failed workflow run. |
This PR toggles the visibility of the connection detail info base on tunnel state.
This change is![Reviewable](https://camo.githubusercontent.com/1541c4039185914e83657d3683ec25920c672c6c5c7ab4240ee7bff601adec0b/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)