From 5db0cb12f00f4b79590719e8ed8c70927dd3a26b Mon Sep 17 00:00:00 2001 From: Satindar Dhillon Date: Thu, 24 Mar 2022 08:34:43 -0700 Subject: [PATCH] remove auth token and env vars from webreader --- .../App/Views/WebReader/WebReader.swift | 6 +----- .../Views/WebReader/WebReaderContainer.swift | 3 --- .../Views/WebReader/WebReaderContent.swift | 21 ++++--------------- .../Queries/ArticleContentQuery.swift | 1 + 4 files changed, 6 insertions(+), 25 deletions(-) diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReader.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReader.swift index 3945ba5ab..dbcff789b 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReader.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReader.swift @@ -10,8 +10,6 @@ struct WebReader: UIViewRepresentable { let openLinkAction: (URL) -> Void let webViewActionHandler: (WKScriptMessage, WKScriptMessageReplyHandler?) -> Void let navBarVisibilityRatioUpdater: (Double) -> Void - let authToken: String - let appEnv: AppEnvironment @Binding var increaseFontActionID: UUID? @Binding var decreaseFontActionID: UUID? @@ -35,10 +33,8 @@ struct WebReader: UIViewRepresentable { WebReaderContent( articleContent: articleContent, item: item, - authToken: authToken, isDark: UITraitCollection.current.userInterfaceStyle == .dark, - fontSize: fontSize(), - appEnv: appEnv + fontSize: fontSize() ) .styledContent, baseURL: ViewsPackage.bundleURL diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift index 8ecb47cdd..503f67417 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift @@ -21,7 +21,6 @@ struct WebReaderContainerView: View { @State var annotation = String() @EnvironmentObject var dataService: DataService - @EnvironmentObject var authenticator: Authenticator @Environment(\.presentationMode) var presentationMode: Binding @StateObject var viewModel = WebReaderViewModel() @@ -194,8 +193,6 @@ struct WebReaderContainerView: View { } navBarVisibilityRatio = $0 }, - authToken: authenticator.authToken ?? "", - appEnv: dataService.appEnvironment, increaseFontActionID: $increaseFontActionID, decreaseFontActionID: $decreaseFontActionID, annotationSaveTransactionID: $annotationSaveTransactionID, diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContent.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContent.swift index ba67b2b1e..7f26820ab 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContent.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContent.swift @@ -7,27 +7,19 @@ struct WebReaderContent { let articleContent: ArticleContent let item: FeedItem let themeKey: String - let authToken: String - let appEnv: AppEnvironment init( articleContent: ArticleContent, item: FeedItem, - authToken: String, isDark: Bool, - fontSize: Int, - appEnv: AppEnvironment + fontSize: Int ) { self.textFontSize = fontSize self.articleContent = articleContent self.item = item self.themeKey = isDark ? "Gray" : "LightGray" - self.authToken = authToken - self.appEnv = appEnv } -// - // swiftlint:disable line_length var styledContent: String { """ @@ -36,6 +28,9 @@ struct WebReaderContent { +
@@ -46,13 +41,6 @@ struct WebReaderContent { \(item.title)
diff --git a/apple/OmnivoreKit/Sources/Services/DataService/Queries/ArticleContentQuery.swift b/apple/OmnivoreKit/Sources/Services/DataService/Queries/ArticleContentQuery.swift index 3c1e5ed5a..ab2b3cc60 100644 --- a/apple/OmnivoreKit/Sources/Services/DataService/Queries/ArticleContentQuery.swift +++ b/apple/OmnivoreKit/Sources/Services/DataService/Queries/ArticleContentQuery.swift @@ -3,6 +3,7 @@ import Foundation import Models import SwiftGraphQL +// swiftlint:disable:next function_body_length public extension DataService { func articleContentPublisher(username: String, slug: String) -> AnyPublisher { enum QueryResult {