mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Display an info alert if a user taps on Highlight but does not have a highlight
This commit is contained in:
parent
a3b53485ed
commit
18fc5d19a4
1 changed files with 11 additions and 2 deletions
|
|
@ -16,6 +16,7 @@ public struct ShareExtensionView: View {
|
|||
@State var messageText: String?
|
||||
|
||||
@State var viewState = ViewState.mainView
|
||||
@State var showHighlightInstructionAlert = false
|
||||
|
||||
enum FocusField: Hashable {
|
||||
case titleEditor
|
||||
|
|
@ -297,7 +298,7 @@ public struct ShareExtensionView: View {
|
|||
Button(
|
||||
action: {},
|
||||
label: {
|
||||
Button(action: {}, label: { Label("Dismiss", systemImage: "arrow.down.to.line") })
|
||||
Button("Dismiss", role: .cancel, action: {})
|
||||
}
|
||||
)
|
||||
Button(action: {
|
||||
|
|
@ -452,7 +453,11 @@ public struct ShareExtensionView: View {
|
|||
highlightSection
|
||||
.onTapGesture {
|
||||
withAnimation {
|
||||
viewState = .viewingHighlight
|
||||
if viewModel.highlightData != nil {
|
||||
viewState = .viewingHighlight
|
||||
} else {
|
||||
showHighlightInstructionAlert = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -481,6 +486,10 @@ public struct ShareExtensionView: View {
|
|||
.sheet(isPresented: $labelsViewModel.showCreateLabelModal) {
|
||||
CreateLabelView(viewModel: labelsViewModel)
|
||||
}
|
||||
.alert("Before saving an article select text in Safari to create a highlight on save.",
|
||||
isPresented: $showHighlightInstructionAlert) {
|
||||
Button("Ok", role: .cancel) { showHighlightInstructionAlert = false }
|
||||
}
|
||||
.environmentObject(viewModel.services.dataService)
|
||||
.task {
|
||||
await labelsViewModel.loadLabelsFromStore(dataService: viewModel.services.dataService)
|
||||
|
|
|
|||
Loading…
Reference in a new issue