From af4966f51a946130059ab6be7520c699c7994da7 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期四, 21 三月 2024 14:43:02 +0800
Subject: [PATCH] #

---
 zy-asrs-flow/src/pages/map/index.jsx |   25 +++++--------------------
 1 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/zy-asrs-flow/src/pages/map/index.jsx b/zy-asrs-flow/src/pages/map/index.jsx
index 2d57e10..fdf9a52 100644
--- a/zy-asrs-flow/src/pages/map/index.jsx
+++ b/zy-asrs-flow/src/pages/map/index.jsx
@@ -219,7 +219,8 @@
     }, [curSprite]);
     const prevCurSprite = prevCurSpriteRef.current;
 
-    const swichFloor = async (floor) => {
+    // fn switch floor
+    const switchFloor = async (floor) => {
         await Utils.fetchMapData(floor);
 
         player.hideGridlines();
@@ -243,7 +244,7 @@
         if (!mapContainer && !dataFetched) {
             return;
         }
-        swichFloor(curFloor);
+        switchFloor(curFloor);
     }, [curFloor]);
 
     // didClickSprite, stop triggers both sprite click and play's selection boxs
@@ -295,24 +296,8 @@
                                         <Button
                                             className='map-header-button'
                                             size={'large'}
-                                            onClick={async () => {
-                                                await Utils.fetchMapData(curFloor);
-
-                                                player.hideGridlines();
-                                                player.hideStarryBackground();
-
-                                                player.activateMapEvent(null);
-
-                                                Utils.removeSelectedEffect();
-                                                setCurSPrite(null);
-                                                setDeviceVisible(false);
-                                                setSettingsVisible(false);
-                                                setDrawerVisible(false);
-
-                                                mapContainer.children.forEach(child => {
-                                                    Utils.viewFeature(child, setCurSPrite);
-                                                })
-
+                                            onClick={() => {
+                                                switchFloor(curFloor)
                                             }}
                                         >
                                             <FormattedMessage id='map.load' defaultMessage='鍔犺浇鍦板浘' />

--
Gitblit v1.9.1