Jelajahi Sumber

add limit

Signed-off-by: ryjiang <jiangruiyi@gmail.com>
ryjiang 1 tahun lalu
induk
melakukan
32c02d07ea
1 mengubah file dengan 5 tambahan dan 0 penghapusan
  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,