Skip to content

Commit 049d457

Browse files
committed
Move support session check to ApplicationPasswordsExperimentState
1 parent 580f104 commit 049d457

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

WooCommerce/Classes/ViewRelated/Dashboard/Settings/Beta features/ApplicationPasswordsExperimentState.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ final class ApplicationPasswordsExperimentState {
1010

1111
private var experimentalFlagSubscription: AnyCancellable?
1212

13+
private static let isSupportSession: Bool = {
14+
#if DEBUG
15+
return ProcessInfo.processInfo.arguments.contains("-support-session")
16+
#else
17+
return false
18+
#endif
19+
}()
20+
1321
init(
1422
stores: StoresManager = ServiceLocator.stores,
1523
availabilityChecker: ApplicationPasswordsExperimentAvailabilityCheckerProtocol = ApplicationPasswordsExperimentAvailabilityChecker(),
@@ -26,6 +34,9 @@ final class ApplicationPasswordsExperimentState {
2634
@MainActor
2735
private var isEnabled: Bool {
2836
get async {
37+
guard !Self.isSupportSession else {
38+
return false
39+
}
2940
return await withCheckedContinuation { continuation in
3041
stores.dispatch(
3142
AppSettingsAction.getAppPasswordsExperimentSettingState { isOn in
@@ -65,23 +76,12 @@ final class ApplicationPasswordsExperimentAvailabilityChecker: ApplicationPasswo
6576
private let userDefaults: UserDefaults
6677
private let stores: StoresManager
6778

68-
private static let isSupportSession: Bool = {
69-
#if DEBUG
70-
return ProcessInfo.processInfo.arguments.contains("-support-session")
71-
#else
72-
return false
73-
#endif
74-
}()
75-
7679
init(userDefaults: UserDefaults = .standard, stores: StoresManager = ServiceLocator.stores) {
7780
self.userDefaults = userDefaults
7881
self.stores = stores
7982
}
8083

8184
var isAvailable: Bool {
82-
guard !Self.isSupportSession else {
83-
return false
84-
}
8585
/// The feature is only available when the user is signed in using WordPress.com account
8686
let isUserAuthenticatedByWPCom = !stores.isAuthenticatedWithoutWPCom
8787
return isUserAuthenticatedByWPCom && cachedRemoteFFValue

WooCommerce/WordPressAuthenticator/Unified Auth/View Related/Get Started/GetStartedViewController.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,6 @@ private extension GetStartedViewController {
545545
return
546546
}
547547
self.configureViewLoading(false)
548-
549548
self.handleLoginError(error)
550549
}
551550
)

0 commit comments

Comments
 (0)