Browse Source

fix segment page is not set as active after refershing the page

Signed-off-by: ryjiang <jiangruiyi@gmail.com>
ryjiang 1 year ago
parent
commit
a98e5aaf8d
1 changed files with 3 additions and 3 deletions
  1. 3 3
      client/src/pages/databases/Databases.tsx

+ 3 - 3
client/src/pages/databases/Databases.tsx

@@ -175,9 +175,6 @@ const CollectionTabs = (props: {
     },
   ];
 
-  // get active collection tab
-  const activeColTab = collectionTabs.findIndex(t => t.path === collectionPage);
-
   if (!isManaged) {
     collectionTabs.push({
       label: collectionTrans('segmentsTab'),
@@ -186,6 +183,9 @@ const CollectionTabs = (props: {
     });
   }
 
+  // get active collection tab
+  const activeColTab = collectionTabs.findIndex(t => t.path === collectionPage);
+
   return (
     <RouteTabList
       tabs={collectionTabs}