From 0ce0cd4a6afe822d5de423b9e7280597ac93bdfe Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 07 三月 2024 14:30:18 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/pages/map/index.jsx | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/zy-asrs-flow/src/pages/map/index.jsx b/zy-asrs-flow/src/pages/map/index.jsx
index a102917..7123c5c 100644
--- a/zy-asrs-flow/src/pages/map/index.jsx
+++ b/zy-asrs-flow/src/pages/map/index.jsx
@@ -71,6 +71,7 @@
const [mapContainer, setMapContainer] = React.useState(null);
const [didClickSprite, setDidClickSprite] = React.useState(false);
const [spriteBySettings, setSpriteBySettings] = React.useState(null);
+ const prevSpriteBySettingsRef = React.useRef();
// init func
React.useEffect(() => {
@@ -175,6 +176,10 @@
if (!mapContainer) {
return;
}
+ prevSpriteBySettingsRef.current = spriteBySettings;
+ if (spriteBySettings && prevSpriteBySettings !== spriteBySettings) {
+ Utils.removeSelectedEffect();
+ }
if (spriteBySettings) {
Utils.showSelectedEffect(spriteBySettings)
setSettingsVisible(true);
@@ -182,6 +187,7 @@
Utils.removeSelectedEffect();
}
}, [spriteBySettings])
+ const prevSpriteBySettings = prevSpriteBySettingsRef.current;
const settingsFinish = () => {
setSpriteBySettings(null);
--
Gitblit v1.9.1