Skip to content
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

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

mojganii
Copy link
Collaborator

@mojganii mojganii commented Jan 27, 2025

This PR toggles the visibility of the connection detail info base on tunnel state.


This change is Reviewable

Copy link

linear bot commented Jan 27, 2025

@mojganii mojganii self-assigned this Jan 27, 2025
@mojganii mojganii added the iOS Issues related to iOS label Jan 27, 2025
Copy link
Collaborator Author

@mojganii mojganii left a 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.

Copy link
Contributor

@buggmagnet buggmagnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 3 files at r1, all commit messages.
Reviewable status: 2 of 3 files reviewed, 1 unresolved discussion

Copy link
Contributor

@rablador rablador left a 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: :shipit: complete! all files reviewed, all discussions resolved

@pinkisemils pinkisemils force-pushed the hide-feature-indicators-in-blocked-state-ios-1039 branch from b2bcc8d to 3aaafb0 Compare January 28, 2025 11:50
@pinkisemils pinkisemils merged commit 964f530 into main Jan 28, 2025
11 checks passed
@pinkisemils pinkisemils deleted the hide-feature-indicators-in-blocked-state-ios-1039 branch January 28, 2025 11:52
Copy link

🚨 End to end tests failed. Please check the failed workflow run.

1 similar comment
Copy link

🚨 End to end tests failed. Please check the failed workflow run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iOS Issues related to iOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants