diff --git a/Riot/Managers/UserSessions/UserSessionProperties.swift b/Riot/Managers/UserSessions/UserSessionProperties.swift index 170c25cdbf..d7f4b31dfd 100644 --- a/Riot/Managers/UserSessions/UserSessionProperties.swift +++ b/Riot/Managers/UserSessions/UserSessionProperties.swift @@ -72,23 +72,6 @@ class UserSessionProperties: NSObject { // MARK: - Public - /// Store the user's use case selection using the Onboarding result. - /// - Parameter useCaseResult: An `OnboardingUseCaseViewModelResult` representing the user's selection. - func store(useCaseResult: OnboardingUseCaseViewModelResult) { - switch useCaseResult { - case .personalMessaging: - useCase = .personalMessaging - case .workMessaging: - useCase = .workMessaging - case .communityMessaging: - useCase = .communityMessaging - case .skipped: - useCase = .skipped - case .customServer: - useCase = nil - } - } - /// Clear all of the stored properties. func delete() { dictionary = [:] diff --git a/Riot/Modules/Onboarding/OnboardingCoordinator.swift b/Riot/Modules/Onboarding/OnboardingCoordinator.swift index 4ea9247e2e..b14707c132 100644 --- a/Riot/Modules/Onboarding/OnboardingCoordinator.swift +++ b/Riot/Modules/Onboarding/OnboardingCoordinator.swift @@ -221,7 +221,25 @@ final class OnboardingCoordinator: NSObject, OnboardingCoordinatorProtocol { if authenticationType == MXKAuthenticationTypeRegister, let useCaseResult = useCaseResult, let userSession = UserSessionsService.shared.mainUserSession { - userSession.properties.store(useCaseResult: useCaseResult) + userSession.properties.useCase = useCaseResult.userSessionPropertyValue + } + } +} + +extension OnboardingUseCaseViewModelResult { + /// The result converted into the type stored in the user session. + var userSessionPropertyValue: UserSessionProperties.UseCase? { + switch self { + case .personalMessaging: + return .personalMessaging + case .workMessaging: + return .workMessaging + case .communityMessaging: + return .communityMessaging + case .skipped: + return .skipped + case .customServer: + return nil } } } diff --git a/RiotNSE/target.yml b/RiotNSE/target.yml index 68a86ca51f..1f15351efa 100644 --- a/RiotNSE/target.yml +++ b/RiotNSE/target.yml @@ -63,6 +63,7 @@ targets: - path: ../Riot/PropertyWrappers/UserDefaultsBackedPropertyWrapper.swift - path: ../Riot/Modules/MatrixKit - path: ../Riot/Modules/Analytics + - path: ../Riot/Managers/UserSessions - path: ../Riot/Managers/AppInfo/ excludes: - "**/*.md" # excludes all files with the .md extension diff --git a/RiotShareExtension/target.yml b/RiotShareExtension/target.yml index 494407323c..945d77d7ae 100644 --- a/RiotShareExtension/target.yml +++ b/RiotShareExtension/target.yml @@ -70,6 +70,7 @@ targets: buildPhase: resources - path: ../Riot/Modules/MatrixKit - path: ../Riot/Modules/Analytics + - path: ../Riot/Managers/UserSessions excludes: - "**/*.md" # excludes all files with the .md extension - path: ../Riot/Generated/MatrixKitStrings.swift diff --git a/SiriIntents/target.yml b/SiriIntents/target.yml index ca60c3bc1a..ddb51c5eb2 100644 --- a/SiriIntents/target.yml +++ b/SiriIntents/target.yml @@ -52,6 +52,7 @@ targets: - path: ../Riot/Managers/Locale/LocaleProvider.swift - path: ../Riot/Modules/MatrixKit - path: ../Riot/Modules/Analytics + - path: ../Riot/Managers/UserSessions - path: ../Riot/Managers/AppInfo/ - path: ../Riot/Managers/Locale/LocaleProviderType.swift - path: ../Riot/Generated/Strings.swift diff --git a/changelog.d/5160.feature b/changelog.d/5160.feature new file mode 100644 index 0000000000..2d567e205d --- /dev/null +++ b/changelog.d/5160.feature @@ -0,0 +1 @@ +Add Onboarding Use Case selection screen after the splash screen.