diff --git a/apple/OmnivoreKit/Sources/App/Views/AI/FullScreenDigestView.swift b/apple/OmnivoreKit/Sources/App/Views/AI/FullScreenDigestView.swift index 951e34b4f..b867b5f6e 100644 --- a/apple/OmnivoreKit/Sources/App/Views/AI/FullScreenDigestView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/AI/FullScreenDigestView.swift @@ -223,10 +223,11 @@ struct FullScreenDigestView: View { .foregroundColor(Color(hex: "#898989")) .lineLimit(1) } else { - Text("We're building you a new digest") - .font(Font.system(size: 17, weight: .semibold)) - .lineLimit(3) - ProgressView() + HStack { + Spacer() + ProgressView() + Spacer() + } } } .padding(15) diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift index ceb322fc2..d02e943e7 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewIOS.swift @@ -192,6 +192,7 @@ struct AnimatingCellHeight: AnimatableModifier { @State var listTitle = "" @State var showExpandedAudioPlayer = false @State var showLibraryDigest = false + @State var showDigestConfig = false @Binding var isEditMode: EditMode @@ -330,6 +331,15 @@ struct AnimatingCellHeight: AnimatableModifier { Text("Sorry digest is only available on iOS 17 and above") } } +// .sheet(isPresented: $showDigestConfig) { +// if #available(iOS 17.0, *) { +// NavigationView { +// DigestConfigView(dataService: dataService) +// } +// } else { +// Text("Sorry digest is only available on iOS 17 and above") +// } +// } .toolbar { toolbarItems } @@ -404,6 +414,14 @@ struct AnimatingCellHeight: AnimatableModifier { .buttonStyle(.plain) .padding(.trailing, 4) } +// if #available(iOS 17.0, *), !dataService.featureFlags.digestEnabled, !viewModel.digestHidden { +// Button( +// action: { showDigestConfig = true }, +// label: { Image.tabDigestSelected } +// ) +// .buttonStyle(.plain) +// .padding(.trailing, 4) +// } if prefersListLayout { Button( action: { isEditMode = isEditMode == .active ? .inactive : .active }, diff --git a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewModel.swift b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewModel.swift index bdda13bda..5b5ff4797 100644 --- a/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewModel.swift +++ b/apple/OmnivoreKit/Sources/App/Views/Home/HomeFeedViewModel.swift @@ -49,6 +49,7 @@ enum LoadingBarStyle { @AppStorage(UserDefaultKey.hideFeatureSection.rawValue) var hideFeatureSection = false @AppStorage(UserDefaultKey.stopUsingFollowingPrimer.rawValue) var stopUsingFollowingPrimer = false @AppStorage("LibraryTabView::hideFollowingTab") var hideFollowingTab = false + @AppStorage("LibraryTabView::digestHidden") var digestHidden = false @AppStorage(UserDefaultKey.lastVisitedDigestId.rawValue) var lastVisitedDigestId = "" @AppStorage(UserDefaultKey.lastSelectedFeaturedItemFilter.rawValue) var featureFilter = FeaturedItemFilter.continueReading.rawValue @@ -401,7 +402,7 @@ enum LoadingBarStyle { func checkForDigestUpdate(dataService: DataService) async { do { - if let result = try? await dataService.getLatestDigest(timeoutInterval: 2) { + if dataService.featureFlags.digestEnabled, let result = try? await dataService.getLatestDigest(timeoutInterval: 2) { if result.id != lastVisitedDigestId { digestIsUnread = true } diff --git a/apple/OmnivoreKit/Sources/App/Views/LibraryTabView.swift b/apple/OmnivoreKit/Sources/App/Views/LibraryTabView.swift index 06908b2cd..61bae6e74 100644 --- a/apple/OmnivoreKit/Sources/App/Views/LibraryTabView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/LibraryTabView.swift @@ -216,5 +216,8 @@ struct LibraryTabView: View { } selectedTab = "inbox" } + .task { + await dataService.tryUpdateFeatureFlags() + } } } diff --git a/apple/OmnivoreKit/Sources/App/Views/RootView/RootView.swift b/apple/OmnivoreKit/Sources/App/Views/RootView/RootView.swift index 3822faa1e..7260e6bab 100644 --- a/apple/OmnivoreKit/Sources/App/Views/RootView/RootView.swift +++ b/apple/OmnivoreKit/Sources/App/Views/RootView/RootView.swift @@ -37,8 +37,6 @@ public struct RootView: View { Services.scheduleBackgroundFetch() #endif } - }.task { - await viewModel.services.dataService.tryUpdateFeatureFlags() } } } diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift index e40cc2052..fe1842fd9 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift @@ -761,9 +761,10 @@ struct WebReaderContainerView: View { } func startUserActivity() { - if let slug = item.slug, let webpageURL = URL(string: "https://omnivore.app/me/\(slug)") { + if let slug = item.slug, + let webpageURL = URL(string: "\(dataService.appEnvironment.webAppBaseURL)/me/\(slug)") { let activity = NSUserActivity(activityType: "com.omnivore.omnivore.openURL") - activity.title = "Open in Safari" + activity.title = "Open in browser" activity.webpageURL = webpageURL activity.isEligibleForHandoff = true activity.becomeCurrent() diff --git a/apple/OmnivoreKit/Sources/Services/DataService/DataService.swift b/apple/OmnivoreKit/Sources/Services/DataService/DataService.swift index 0b131f3c7..9794725af 100644 --- a/apple/OmnivoreKit/Sources/Services/DataService/DataService.swift +++ b/apple/OmnivoreKit/Sources/Services/DataService/DataService.swift @@ -300,7 +300,7 @@ public final class DataService: ObservableObject { } return objectID } - + public func tryUpdateFeatureFlags() async { if let features = (try? await fetchViewer())?.enabledFeatures { featureFlags.digestEnabled = features.contains("ai-digest")