Skip to content

Commit ce56a7d

Browse files
committed
[feat] Dependency openURL 리팩토링
1 parent 190e2ae commit ce56a7d

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Projects/Feature/FeatureLogin/Sources/Splash/SplashFeature.swift

+7-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ public struct SplashFeature {
1717
/// - Dependency
1818
@Dependency(\.continuousClock)
1919
var clock
20-
@Dependency(UserDefaultsClient.self)
20+
@Dependency(\.openURL)
21+
var openURL
22+
@Dependency(UserDefaultsClient.self)
2123
var userDefaults
2224
@Dependency(AuthClient.self)
2325
var authClient
@@ -213,11 +215,11 @@ private extension SplashFeature {
213215
func handleScopeAction(_ action: Action.ScopeAction, state: inout State) -> Effect<Action> {
214216
switch action {
215217
case let .alert(.presented(.앱스토어_이동(trackId))):
216-
if let url = URL(string: "https://apps.apple.com/app/id\(trackId)"),
217-
UIApplication.shared.canOpenURL(url) {
218-
UIApplication.shared.open(url, options: [:], completionHandler: nil)
218+
return .run { _ in
219+
if let url = URL(string: "https://apps.apple.com/app/id\(trackId)") {
220+
await openURL.callAsFunction(url)
221+
}
219222
}
220-
return .none
221223

222224
case .alert:
223225
return .none

0 commit comments

Comments
 (0)