diff --git a/Projects/Feature/FeatureLogin/Sources/Splash/SplashFeature.swift b/Projects/Feature/FeatureLogin/Sources/Splash/SplashFeature.swift index 796e1501..3f3cdcdd 100644 --- a/Projects/Feature/FeatureLogin/Sources/Splash/SplashFeature.swift +++ b/Projects/Feature/FeatureLogin/Sources/Splash/SplashFeature.swift @@ -17,7 +17,9 @@ public struct SplashFeature { /// - Dependency @Dependency(\.continuousClock) var clock - @Dependency(UserDefaultsClient.self) + @Dependency(\.openURL) + var openURL + @Dependency(UserDefaultsClient.self) var userDefaults @Dependency(AuthClient.self) var authClient @@ -213,11 +215,11 @@ private extension SplashFeature { func handleScopeAction(_ action: Action.ScopeAction, state: inout State) -> Effect { switch action { case let .alert(.presented(.앱스토어_이동(trackId))): - if let url = URL(string: "https://apps.apple.com/app/id\(trackId)"), - UIApplication.shared.canOpenURL(url) { - UIApplication.shared.open(url, options: [:], completionHandler: nil) + return .run { _ in + if let url = URL(string: "https://apps.apple.com/app/id\(trackId)") { + await openURL.callAsFunction(url) + } } - return .none case .alert: return .none