From 43d7de56b847f8236a66b123a0faed84e92173d2 Mon Sep 17 00:00:00 2001 From: aronmal Date: Tue, 16 Aug 2022 17:47:53 +0200 Subject: [PATCH] targetPreview missle fix `targetPreview` did not show up when moving the mouse from an empty to a missle field and then back to the empty field. The cause of the problem was no update of the position when going over the missle field and when going back resultend in no `potisionChange` which reslted into an early return. Fixed this by adding the dependency `show` for early return caused by no `positionChange` which blocks the early return when `targetPreview` is not being `show`-n. --- frontend/src/App.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 9580d21..a4b5ffa 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -22,7 +22,7 @@ function App() { const {newX, newY, shouldShow, appearOK, eventReady, show, x, y} = targetPreview; const positionChange = !(x === newX && y === newY); // if not ready or no new position - if (!eventReady || !positionChange) + if (!eventReady || (!positionChange && show)) return; if (show) { // hide preview to change position when hidden