From 65640d7b044256cb3afada5c6e66100e2e9bed99 Mon Sep 17 00:00:00 2001 From: Satindar Dhillon Date: Wed, 18 May 2022 09:13:26 -0700 Subject: [PATCH] add feature flag for read now button --- apple/OmnivoreKit/Sources/Utils/FeatureFlags.swift | 1 + apple/OmnivoreKit/Sources/Views/ShareExtensionView.swift | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apple/OmnivoreKit/Sources/Utils/FeatureFlags.swift b/apple/OmnivoreKit/Sources/Utils/FeatureFlags.swift index 7b5d0f704..5642e89eb 100644 --- a/apple/OmnivoreKit/Sources/Utils/FeatureFlags.swift +++ b/apple/OmnivoreKit/Sources/Utils/FeatureFlags.swift @@ -10,6 +10,7 @@ public enum FeatureFlag { public static let showAccountDeletion = false public static let enableSnoozeFromShareExtension = false public static let enableRemindersFromShareExtension = false + public static let enableReadNow = false public static let enablePushNotifications = false public static let enableShareButton = false public static let enableSnooze = false diff --git a/apple/OmnivoreKit/Sources/Views/ShareExtensionView.swift b/apple/OmnivoreKit/Sources/Views/ShareExtensionView.swift index 44109b86f..8cfa95fbb 100644 --- a/apple/OmnivoreKit/Sources/Views/ShareExtensionView.swift +++ b/apple/OmnivoreKit/Sources/Views/ShareExtensionView.swift @@ -203,14 +203,14 @@ public struct ShareExtensionChildView: View { .padding(.horizontal) HStack { - if case ShareExtensionStatus.success = status { + if case ShareExtensionStatus.success = status, FeatureFlag.enableReadNow { Button( action: { readNowButtonAction() }, label: { Text("Read Now").frame(maxWidth: .infinity) } ) .buttonStyle(RoundedRectButtonStyle()) } - if case ShareExtensionStatus.processing = status { + if case ShareExtensionStatus.processing = status, FeatureFlag.enableReadNow { Button(action: {}, label: { ProgressView().frame(maxWidth: .infinity) }) .buttonStyle(RoundedRectButtonStyle()) }