File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
packages/compass-indexes/src/components/indexes-toolbar Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,19 @@ const createIndexButtonContainerStyles = css({
5454 width : 'fit-content' ,
5555} ) ;
5656
57+ const MIN_SEARCH_INDEX_MANAGEMENT_SERVER_VERSION = '6.0.7' ;
58+
59+ const serverSupportsSearchIndexManagement = ( serverVersion : string ) => {
60+ try {
61+ return semver . gte (
62+ serverVersion ,
63+ MIN_SEARCH_INDEX_MANAGEMENT_SERVER_VERSION
64+ ) ;
65+ } catch {
66+ return true ;
67+ }
68+ } ;
69+
5770type IndexesToolbarProps = {
5871 namespace : string ;
5972 indexView : IndexView ;
@@ -191,7 +204,7 @@ export const IndexesToolbar: React.FunctionComponent<IndexesToolbarProps> = ({
191204 </ SegmentedControlOption >
192205 }
193206 >
194- { semver . gte ( serverVersion , '6.0.7' ) ? (
207+ { serverSupportsSearchIndexManagement ( serverVersion ) ? (
195208 < p >
196209 Unable to fetch search indexes. This can occur when your
197210 cluster does not support search indexes or the listing
You can’t perform that action at this time.
0 commit comments