File tree Expand file tree Collapse file tree 2 files changed +8
-18
lines changed
compass/src/app/components Expand file tree Collapse file tree 2 files changed +8
-18
lines changed Original file line number Diff line number Diff line change 1- import { useConnectionIds } from '@mongodb-js/compass-connections/provider' ;
2- import { getGenuineMongoDB } from 'mongodb-build-info' ;
1+ import { useHasNonGenuineConnections } from '@mongodb-js/compass-app-stores/provider' ;
32import React from 'react' ;
43import { CompassAssistantDrawer } from '@mongodb-js/compass-assistant' ;
54
@@ -11,16 +10,12 @@ export function CompassAssistantDrawerWithConnections({
1110} : {
1211 appName : string ;
1312} ) {
14- // Check for non-genuine connections
15- const activeConnectionIds = useConnectionIds (
16- ( conn ) =>
17- getGenuineMongoDB ( conn . info . connectionOptions . connectionString )
18- . isGenuine === false && conn . status === 'connected'
19- ) ;
13+ const hasNonGenuineConnections = useHasNonGenuineConnections ( ) ;
14+
2015 return (
2116 < CompassAssistantDrawer
2217 appName = { appName }
23- hasNonGenuineConnections = { activeConnectionIds . length > 0 }
18+ hasNonGenuineConnections = { hasNonGenuineConnections }
2419 />
2520 ) ;
2621}
Original file line number Diff line number Diff line change 1- import { useConnectionIds } from '@mongodb-js/compass-connections/provider' ;
2- import { getGenuineMongoDB } from 'mongodb-build-info' ;
1+ import { useHasNonGenuineConnections } from '@mongodb-js/compass-app-stores/provider' ;
32import React from 'react' ;
43import { CompassAssistantDrawer } from '@mongodb-js/compass-assistant' ;
54
@@ -11,16 +10,12 @@ export function CompassAssistantDrawerWithConnections({
1110} : {
1211 appName : string ;
1312} ) {
14- // Check for non-genuine connections
15- const activeConnectionIds = useConnectionIds (
16- ( conn ) =>
17- getGenuineMongoDB ( conn . info . connectionOptions . connectionString )
18- . isGenuine === false && conn . status === 'connected'
19- ) ;
13+ const hasNonGenuineConnections = useHasNonGenuineConnections ( ) ;
14+
2015 return (
2116 < CompassAssistantDrawer
2217 appName = { appName }
23- hasNonGenuineConnections = { activeConnectionIds . length > 0 }
18+ hasNonGenuineConnections = { hasNonGenuineConnections }
2419 />
2520 ) ;
2621}
You can’t perform that action at this time.
0 commit comments