Skip to content

Commit

Permalink
Updated reader, fixed popover hiding
Browse files Browse the repository at this point in the history
  • Loading branch information
michalrentka committed Nov 27, 2024
1 parent a72bc4b commit aab23bc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ enum HtmlEpubReaderAction {
case deinitialiseReader
case deselectAnnotationDuringEditing(String)
case deselectSelectedAnnotation
case hideAnnotationPopover
case initialiseReader
case loadDocument
case parseAndCacheComment(key: String, comment: String)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,6 @@ final class HtmlEpubReaderActionHandler: ViewModelActionHandler, BackgroundDbPro
state.changes.insert(.popover)
}

case .hideAnnotationPopover:
update(viewModel: viewModel) { state in
state.annotationPopoverKey = nil
state.annotationPopoverRect = nil
state.changes.insert(.popover)
}

case .setComment(let key, let comment):
set(comment: comment, key: key, viewModel: viewModel)

Expand Down Expand Up @@ -928,6 +921,9 @@ final class HtmlEpubReaderActionHandler: ViewModelActionHandler, BackgroundDbPro
// Update selection
if selectionDeleted {
_select(key: nil, didSelectInDocument: true, state: &state)
state.annotationPopoverKey = nil
state.annotationPopoverRect = nil
state.changes.insert(.popover)
}

// Disable sidebar editing if there are no results
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ class HtmlEpubDocumentViewController: UIViewController {
}

if params.isEmpty {
viewModel.process(action: .hideAnnotationPopover)
return
}

Expand Down

0 comments on commit aab23bc

Please sign in to comment.