From 19a5495bd37aa067129b7dea8612fe0d8fa4c54d Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 6 Dec 2022 11:46:36 +0800 Subject: [PATCH] Reset showRecommendSheet properly so the form sheet can be re-opened --- .../Sources/App/Views/WebReader/WebReaderContainer.swift | 3 ++- .../Sources/Services/DataService/Mutations/SavePage.swift | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift index 36111be75..408da9ef7 100644 --- a/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift +++ b/apple/OmnivoreKit/Sources/App/Views/WebReader/WebReaderContainer.swift @@ -222,7 +222,6 @@ struct WebReaderContainerView: View { ) Button( action: { - // dataService.updateLinkReadingProgress(itemID: item.unwrappedID, readingProgress: 0, anchorIndex: 0) showRecommendSheet = true }, label: { Label("Recommend", systemImage: "sparkles") } @@ -365,6 +364,8 @@ struct WebReaderContainerView: View { dataService: dataService, viewModel: RecommendToViewModel(pageID: item.unwrappedID) ) + }.onDisappear { + showRecommendSheet = false } } .sheet(isPresented: $showHighlightAnnotationModal) { diff --git a/apple/OmnivoreKit/Sources/Services/DataService/Mutations/SavePage.swift b/apple/OmnivoreKit/Sources/Services/DataService/Mutations/SavePage.swift index 8b00c363e..bf4d9ffef 100644 --- a/apple/OmnivoreKit/Sources/Services/DataService/Mutations/SavePage.swift +++ b/apple/OmnivoreKit/Sources/Services/DataService/Mutations/SavePage.swift @@ -59,7 +59,6 @@ public extension DataService { } } case let .failure(error): - print("RESULT: ", result) continuation.resume(throwing: SaveArticleError.make(from: error)) } }