Skip to content

Commit

Permalink
[trello.com/c/mJMhirqv] Incorrect position fix
Browse files Browse the repository at this point in the history
  • Loading branch information
just-software-dev committed Dec 10, 2024
1 parent b69b381 commit 4831483
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,17 @@ private extension AdvancedContextMenuManager {
}

// MARK: Delegate

extension AdvancedContextMenuManager: OverlayViewDelegate {
func willDissmis() {
guard
let newPosition = getPositionOnScreen?(),
newPosition != locationOnScreen
else { return }

viewModel?.update(locationOnScreen: newPosition)
}

func didDissmis() {
didDismissMenuAction?(messageId)
getPositionOnScreen = nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ final class ContextMenuOverlayViewModel: ObservableObject {
}

@MainActor func dismiss() async {
delegate?.willDissmis()

await animate(duration: animationDuration) {
self.additionalMenuVisible.toggle()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Foundation

@MainActor
protocol OverlayViewDelegate: AnyObject {
func willDissmis()
func didDissmis()
func didAppear()
}

0 comments on commit 4831483

Please sign in to comment.