Browse Source

fix broken vector database link (#520)

Signed-off-by: ryjiang <jiangruiyi@gmail.com>
ryjiang 1 year ago
parent
commit
911932d47c
1 changed files with 4 additions and 11 deletions
  1. 4 11
      client/src/pages/databases/collections/StatusAction.tsx

+ 4 - 11
client/src/pages/databases/collections/StatusAction.tsx

@@ -183,17 +183,10 @@ const StatusAction: FC<StatusActionType> = props => {
               className={classes.extraBtn}
               tooltip={collectionTrans('clickToSearch')}
               onClick={() => {
-                // navigate to search page, just replace the current url 'overview' with 'search'
-                // http://localhost:3001/#/databases/default/testNode/overview -> http://localhost:3001/#/databases/default/testNode/search
-                navigate(
-                  window.location.pathname +
-                    window.location.hash
-                      .replace('overview', 'search')
-                      .replace('#/', ''),
-                  {
-                    replace: true,
-                  }
-                );
+                const currentHash = window.location.hash;
+                const newHash = currentHash.replace('overview', 'search');
+
+                window.location.hash = newHash;
               }}
             >
               {btnTrans('vectorSearch')}