瀏覽代碼

feat: prevent click same

GyDi 3 年之前
父節點
當前提交
6b3e7cbc08
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      src/pages/profile.tsx

+ 1 - 0
src/pages/profile.tsx

@@ -77,6 +77,7 @@ const ProfilePage = () => {
 
   const lockRef = useRef(false);
   const onProfileChange = (index: number) => {
+    if (index === profiles.current || lockRef.current) return;
     if (lockRef.current) return;
     lockRef.current = true;
     putProfiles(index)