Skip to content

Commit

Permalink
Fix build errors in extensions.
Browse files Browse the repository at this point in the history
Add changelog.
  • Loading branch information
pixlwave committed Feb 1, 2022
1 parent 949a6cf commit 01f52ad
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 18 deletions.
17 changes: 0 additions & 17 deletions Riot/Managers/UserSessions/UserSessionProperties.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [:]
Expand Down
20 changes: 19 additions & 1 deletion Riot/Modules/Onboarding/OnboardingCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
1 change: 1 addition & 0 deletions RiotNSE/target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions RiotShareExtension/target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions SiriIntents/target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions changelog.d/5160.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add Onboarding Use Case selection screen after the splash screen.

0 comments on commit 01f52ad

Please sign in to comment.