From 8ccce365e4e6ee136c41726942c35a2da31c0119 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Mon, 1 Jul 2024 13:54:14 +0800 Subject: [PATCH] Update deps to resolve iOS18 issues --- .../xcshareddata/swiftpm/Package.resolved | 16 ++++++++-------- apple/OmnivoreKit/Package.swift | 4 ++-- .../Sources/App/PDFSupport/PDFViewer.swift | 4 ++-- .../App/Views/AI/FullScreenDigestView.swift | 4 ++-- .../Sources/App/Views/Home/HomeFeedViewIOS.swift | 1 + .../Sources/App/Views/RootView/RootView.swift | 1 + .../Sources/App/Views/SelfHostSettingsView.swift | 6 +++--- .../App/Views/WebReader/WebReaderContainer.swift | 10 +++++----- .../WebReader/WebReaderLoadingContainer.swift | 4 ++-- 9 files changed, 26 insertions(+), 24 deletions(-) diff --git a/apple/Omnivore.xcworkspace/xcshareddata/swiftpm/Package.resolved b/apple/Omnivore.xcworkspace/xcshareddata/swiftpm/Package.resolved index ed109f98e..c75c8d8a0 100644 --- a/apple/Omnivore.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/apple/Omnivore.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -32,8 +32,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/nathantannar4/Engine", "state" : { - "revision" : "e9867eb6df013abc65c3437d295e594077469a13", - "version" : "1.5.1" + "revision" : "0d2d5647921473be4aac40cb70ad13900f56ed2b", + "version" : "1.8.1" } }, { @@ -167,8 +167,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/PSPDFKit/PSPDFKit-SP", "state" : { - "revision" : "fcff39b2b7741662286dc4323ea255a0ea53fcd3", - "version" : "13.1.0" + "revision" : "fff37620437d93571e38675440da5257ff4a9fd5", + "version" : "13.7.0" } }, { @@ -239,8 +239,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/nathantannar4/Transmission", "state" : { - "revision" : "9517912f8f528c777f86f7896b5c35d7e43fa916", - "version" : "1.0.1" + "revision" : "6b3e6b46f34d0d18715d27c46e0053f1eda1bcd1", + "version" : "1.3.1" } }, { @@ -248,8 +248,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/nathantannar4/Turbocharger", "state" : { - "revision" : "095344c0cac57873e1552f30d3561ab1bec5ae35", - "version" : "1.1.4" + "revision" : "9420e40f902021469ee7b4c5a0c7849f5bb26290", + "version" : "1.3.1" } }, { diff --git a/apple/OmnivoreKit/Package.swift b/apple/OmnivoreKit/Package.swift index 4683efbfa..5c3b96b5e 100644 --- a/apple/OmnivoreKit/Package.swift +++ b/apple/OmnivoreKit/Package.swift @@ -73,9 +73,9 @@ var dependencies: [Package.Dependency] { .package(url: "https://github.com/PostHog/posthog-ios.git", from: "2.0.0"), // .package(url: "https://github.com/nathantannar4/Engine", exact: "1.0.1"), // .package(url: "https://github.com/nathantannar4/Turbocharger", exact: "1.1.4"), - .package(url: "https://github.com/nathantannar4/Transmission", exact: "1.0.1") + .package(url: "https://github.com/nathantannar4/Transmission", exact: "1.3.1") ] // Comment out following line for macOS build - deps.append(.package(url: "https://github.com/PSPDFKit/PSPDFKit-SP", from: "13.1.0")) + deps.append(.package(url: "https://github.com/PSPDFKit/PSPDFKit-SP", from: "13.7.0")) return deps } diff --git a/apple/OmnivoreKit/Sources/App/PDFSupport/PDFViewer.swift b/apple/OmnivoreKit/Sources/App/PDFSupport/PDFViewer.swift index e6dd22008..e61d5eab8 100644 --- a/apple/OmnivoreKit/Sources/App/PDFSupport/PDFViewer.swift +++ b/apple/OmnivoreKit/Sources/App/PDFSupport/PDFViewer.swift @@ -54,7 +54,7 @@ import Utils @State private var showAnnotationModal = false @State private var showSettingsModal = false - @Environment(\.dismiss) private var dismiss + @Environment(\.presentationCoordinator) var presentationCoordinator init(viewModel: PDFViewerViewModel) { self.viewModel = viewModel @@ -479,7 +479,7 @@ import Utils @objc public func pop() { if let viewer = self.viewer { - viewer.dismiss() + viewer.presentationCoordinator.dismiss() } } diff --git a/apple/OmnivoreKit/Sources/App/Views/AI/FullScreenDigestView.swift b/apple/OmnivoreKit/Sources/App/Views/AI/FullScreenDigestView.swift index 3ee28662a..2f9614b68 100644 --- a/apple/OmnivoreKit/Sources/App/Views/AI/FullScreenDigestView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/AI/FullScreenDigestView.swift @@ -112,7 +112,7 @@ struct FullScreenDigestView: View { let dataService: DataService let audioController: AudioController - @Environment(\.dismiss) private var dismiss + @Environment(\.presentationCoordinator) var presentationCoordinator public init(dataService: DataService, audioController: AudioController) { self.dataService = dataService @@ -221,7 +221,7 @@ struct FullScreenDigestView: View { var closeButton: some View { Button(action: { - dismiss() + presentationCoordinator.dismiss() }, label: { Text("Close") .foregroundColor(Color.blue) diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift index b0a724ab0..e43d8341d 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift @@ -546,6 +546,7 @@ struct AnimatingCellHeight: AnimatableModifier { if presentingItem.isPDF { PDFContainerView(item: presentingItem) } else { + let too = print("$viewModel.linkIsActive", viewModel.linkIsActive) WebReaderContainerView(item: presentingItem) } } else { diff --git a/apple/OmnivoreKit/Sources/App/Views/RootView/RootView.swift b/apple/OmnivoreKit/Sources/App/Views/RootView/RootView.swift index 7260e6bab..877bb05bb 100644 --- a/apple/OmnivoreKit/Sources/App/Views/RootView/RootView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/RootView/RootView.swift @@ -89,3 +89,4 @@ struct InnerRootView: View { // } #endif } + diff --git a/apple/OmnivoreKit/Sources/App/Views/SelfHostSettingsView.swift b/apple/OmnivoreKit/Sources/App/Views/SelfHostSettingsView.swift index 4d7a57dae..0486a3951 100644 --- a/apple/OmnivoreKit/Sources/App/Views/SelfHostSettingsView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/SelfHostSettingsView.swift @@ -10,9 +10,9 @@ class SelfHostSettingsViewModel: ObservableObject { } struct SelfHostSettingsView: View { - @State var apiServerAddress = UserDefaults(suiteName: "group.app.omnivoreapp").string(forKey: AppEnvironmentUserDefaultKey.serverBaseURL.rawValue) ?? "" - @State var webServerAddress = UserDefaults(suiteName: "group.app.omnivoreapp").string(forKey: AppEnvironmentUserDefaultKey.webAppBaseURL.rawValue) ?? "" - @State var ttsServerAddress = UserDefaults(suiteName: "group.app.omnivoreapp").string(forKey: AppEnvironmentUserDefaultKey.ttsBaseURL.rawValue) ?? "" + @State var apiServerAddress = UserDefaults(suiteName: "group.app.omnivoreapp")?.string(forKey: AppEnvironmentUserDefaultKey.serverBaseURL.rawValue) ?? "" + @State var webServerAddress = UserDefaults(suiteName: "group.app.omnivoreapp")?.string(forKey: AppEnvironmentUserDefaultKey.webAppBaseURL.rawValue) ?? "" + @State var ttsServerAddress = UserDefaults(suiteName: "group.app.omnivoreapp")?.string(forKey: AppEnvironmentUserDefaultKey.ttsBaseURL.rawValue) ?? "" @State var showConfirmAlert = false diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift index fe1842fd9..66cd3a13f 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift @@ -10,7 +10,7 @@ import WebKit // swiftlint:disable file_length type_body_length struct WebReaderContainerView: View { @State var item: Models.LibraryItem - @Environment(\.dismiss) private var dismiss + @Environment(\.presentationCoordinator) var presentationCoordinator @State private var showPreferencesPopover = false @State private var showPreferencesFormsheet = false @@ -268,7 +268,7 @@ struct WebReaderContainerView: View { #if os(iOS) Button( action: { - dismiss() + presentationCoordinator.dismiss() }, label: { Image.chevronRight @@ -679,7 +679,7 @@ struct WebReaderContainerView: View { WebViewManager.shared().loadHTMLString(WebReaderContent.emptyContent(isDark: Color.isDarkMode), baseURL: nil) } .onReceive(NotificationCenter.default.publisher(for: Notification.Name("PopToRoot"))) { _ in - dismiss() + presentationCoordinator.dismiss() } .ignoresSafeArea(.all, edges: .bottom) } @@ -699,7 +699,7 @@ struct WebReaderContainerView: View { let isArchived = item.isArchived dataService.archiveLink(objectID: item.objectID, archived: !isArchived) #if os(iOS) - dismiss() + presentationCoordinator.dismiss() Snackbar.show(message: isArchived ? "Unarchived" : "Archived", undoAction: { dataService.archiveLink(objectID: item.objectID, archived: isArchived) @@ -736,7 +736,7 @@ struct WebReaderContainerView: View { } func delete() { - dismiss() + presentationCoordinator.dismiss() #if os(iOS) DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(100)) { diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderLoadingContainer.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderLoadingContainer.swift index b8f068c71..fd8d32623 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderLoadingContainer.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderLoadingContainer.swift @@ -41,11 +41,11 @@ import Views public struct WebReaderLoadingContainer: View { let requestID: String - @Environment(\.dismiss) private var dismiss @EnvironmentObject var dataService: DataService @EnvironmentObject var audioController: AudioController @StateObject var viewModel = WebReaderLoadingContainerViewModel() + @Environment(\.presentationCoordinator) var presentationCoordinator public var body: some View { if let item = viewModel.item { @@ -76,7 +76,7 @@ public struct WebReaderLoadingContainer: View { VStack(spacing: 15) { Text(errorMessage) Button(action: { - dismiss() + presentationCoordinator.dismiss() }, label: { Text("Dismiss") })