소스 검색

add limit

Signed-off-by: ryjiang <jiangruiyi@gmail.com>
ryjiang 1 년 전
부모
커밋
32c02d07ea
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      client/src/pages/connect/AuthForm.tsx

+ 5 - 0
client/src/pages/connect/AuthForm.tsx

@@ -122,6 +122,11 @@ export const AuthForm = () => {
         },
       ];
 
+      // if history connections are more than 16, remove the first one, but it should keep the default one
+      if (newHistory.length > 16) {
+        newHistory.shift();
+      }
+     
       // save to local storage
       window.localStorage.setItem(
         ATTU_AUTH_HISTORY,