Skip to content

Commit 2e587ab

Browse files
authored
feat: Login interapp show only not logged-in accounts (#1886)
2 parents 459b8b5 + 212abf1 commit 2e587ab

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

Mail/Views/Onboarding/OnboardingBottomButtonsView.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import DesignSystem
2020
import InfomaniakCoreSwiftUI
21+
import InfomaniakDI
2122
import InterAppLogin
2223
import MailCore
2324
import MailCoreUI
@@ -26,6 +27,8 @@ import SwiftModalPresentation
2627
import SwiftUI
2728

2829
struct OnboardingBottomButtonsView: View {
30+
@InjectService private var accountManager: AccountManager
31+
2932
@EnvironmentObject private var navigationState: RootViewState
3033

3134
@ModalState(context: ContextKeys.onboarding) private var isPresentingCreateAccount = false
@@ -42,7 +45,7 @@ struct OnboardingBottomButtonsView: View {
4245

4346
var body: some View {
4447
VStack(spacing: IKPadding.mini) {
45-
ContinueWithAccountView(isLoading: loginHandler.isLoading) {
48+
ContinueWithAccountView(isLoading: loginHandler.isLoading, excludingUserIds: accountManager.accountIds) {
4649
Task { @MainActor in
4750
// We have to wait for closing animation before opening the login WebView modally
4851
try? await Task.sleep(nanoseconds: 500_000_000)

MailCore/Cache/AccountManager/AccountManager.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ public final class AccountManager: RefreshTokenDelegate, ObservableObject {
8484
return Array(tokenStore.getAllTokens().values)
8585
}
8686

87+
public var accountIds: [Int] {
88+
return accounts.map { $0.userId }
89+
}
90+
8791
public let userProfileStore = UserProfileStore()
8892
private let mailboxManagers = SendableDictionary<String, MailboxManager>()
8993
private let contactManagers = SendableDictionary<String, ContactManager>()

Tuist/Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tuist/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ let package = Package(
6363
.package(url: "https://github.com/Infomaniak/ios-bug-tracker", .upToNextMajor(from: "12.0.0")),
6464
.package(url: "https://github.com/Infomaniak/ios-version-checker", .upToNextMajor(from: "11.0.0")),
6565
.package(url: "https://github.com/Infomaniak/ios-device-check", .upToNextMajor(from: "1.1.0")),
66-
.package(url: "https://github.com/Infomaniak/ios-features", .upToNextMajor(from: "2.1.0")),
66+
.package(url: "https://github.com/Infomaniak/ios-features", .upToNextMajor(from: "2.2.0")),
6767
.package(url: "https://github.com/Infomaniak/ios-onboarding", .upToNextMajor(from: "1.1.0")),
6868
.package(url: "https://github.com/Infomaniak/swift-modal-presentation", .upToNextMajor(from: "1.0.0")),
6969
.package(url: "https://github.com/Infomaniak/SwiftSoup", .upToNextMajor(from: "1.3.0")),

0 commit comments

Comments
 (0)