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

PIA-1058: App navigation setup #51

Merged
merged 2 commits into from
Dec 20, 2023

Conversation

kp-laura-sempere
Copy link
Collaborator

@kp-laura-sempere kp-laura-sempere commented Dec 19, 2023

  • Created RootContainerView that is responsible to show the correct flow based on the authentication state:
  1. Splash
  2. Not authenticated flow (for now only login screen)
  3. Authenticated flow when Onboarding is not finished (Vpn Onboarding flow)
  4. Authenticated flow when Onboarding is done (Dashboard view)

NOTE: This PR depends on this other PR from PIALibrary:
pia-foss/mobile-ios-library#24

Copy link
Collaborator

@kp-said-rehouni kp-said-rehouni left a comment

Choose a reason for hiding this comment

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

Great job @kp-laura-sempere! Just a couple of comments to see what you think.
Thank you!


import Foundation
import SwiftUI
import PIALibrary
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think since this is presentation, we could avoid leaking framework details like SwiftUI. I'd also try to avoid importing PIALibrary on presentation and domain layers. It's true that we will be removing PIALibrary but the AccountProvider protocol exposes many different methods that this ViewModel does not care about. I'd suggest to have something in between which will only expose the methods the ViewModel will be using.
What do you think?

// TODO: Update this value from the Vpn OnBoarding installation profile screen
@AppStorage(.kOnboardingVpnProfileInstalled) var onBoardingVpnProfileInstalled = true

let accountProvider: AccountProvider
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd suggest the same as the comment above. To have something that hides all the AccountProvider methods and it exposes only what the ViewModel needs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I was thinking the same. I think we can create a AccountProviderType protocol that only contains the methods that the presentation layer needs.
Let me try to add it 👍

Copy link
Collaborator

@kp-said-rehouni kp-said-rehouni left a comment

Choose a reason for hiding this comment

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

LGTM! Great job @kp-laura-sempere!

@kp-laura-sempere kp-laura-sempere merged commit 4618b55 into master Dec 20, 2023
1 check failed
@kp-laura-sempere kp-laura-sempere deleted the PIA-1058_app_navigation_setup branch December 20, 2023 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants