Browse Source

add limit

Signed-off-by: ryjiang <jiangruiyi@gmail.com>
ryjiang 11 months ago
parent
commit
32c02d07ea
1 changed files with 5 additions and 0 deletions
  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
       // save to local storage
       window.localStorage.setItem(
       window.localStorage.setItem(
         ATTU_AUTH_HISTORY,
         ATTU_AUTH_HISTORY,