From 60b9a18c5489caa477cac6ace776f758c38651dd Mon Sep 17 00:00:00 2001 From: Daiki Matsudate Date: Tue, 12 Mar 2024 23:30:43 +0900 Subject: [PATCH] Fix modal crash Signed-off-by: Daiki Matsudate --- MyLibrary/Sources/ScheduleFeature/Detail.swift | 2 +- MyLibrary/Sources/trySwiftFeature/Profile.swift | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/MyLibrary/Sources/ScheduleFeature/Detail.swift b/MyLibrary/Sources/ScheduleFeature/Detail.swift index 2fcbcdd..a422741 100644 --- a/MyLibrary/Sources/ScheduleFeature/Detail.swift +++ b/MyLibrary/Sources/ScheduleFeature/Detail.swift @@ -53,7 +53,7 @@ public struct ScheduleDetail { return .none } } - ifLet(\.$destination, action: \.destination) + .ifLet(\.$destination, action: \.destination) } } diff --git a/MyLibrary/Sources/trySwiftFeature/Profile.swift b/MyLibrary/Sources/trySwiftFeature/Profile.swift index 3672c77..d8f9977 100644 --- a/MyLibrary/Sources/trySwiftFeature/Profile.swift +++ b/MyLibrary/Sources/trySwiftFeature/Profile.swift @@ -46,14 +46,14 @@ public struct Profile { return .none } } - ifLet(\.$destination, action: \.destination) + .ifLet(\.$destination, action: \.destination) } } @ViewAction(for: Profile.self) public struct ProfileView: View { - public var store: StoreOf + @Bindable public var store: StoreOf public init(store: StoreOf) { self.store = store @@ -88,5 +88,9 @@ public struct ProfileView: View { } .navigationTitle(store.organizer.name) } + .sheet(item: $store.scope(state: \.destination?.safari, action: \.destination.safari)) { sheetStore in + SafariViewRepresentation(url: sheetStore.url) + .ignoresSafeArea() + } } }