@@ -75,8 +75,7 @@ import {
7575 findDatabaseByNameOrAlias ,
7676 getAvailableSettings ,
7777 getDatabases ,
78- getRemoteContentHostnameAllowlist ,
79- SYSTEM_DB
78+ getRemoteContentHostnameAllowlist
8079} from 'shared/modules/dbMeta/dbMetaDuck'
8180import { getUserCapabilities } from 'shared/modules/features/featuresDuck'
8281import * as frames from 'shared/modules/frames/framesDuck'
@@ -102,6 +101,10 @@ import {
102101} from 'shared/services/bolt/txMetadata'
103102import { objToCss , parseGrass } from 'shared/services/grassUtils'
104103import { URL } from 'whatwg-url'
104+ import {
105+ getCurrentDatabase ,
106+ isSystemOrCompositeDb
107+ } from 'shared/utils/selectors'
105108
106109const PLAY_FRAME_TYPES = [ 'play' , 'play-remote' ]
107110
@@ -150,7 +153,9 @@ const availableCommands = [
150153 name : 'set-params' ,
151154 match : ( cmd : any ) => / ^ p a r a m s ? \s / . test ( cmd ) ,
152155 exec ( action : any , put : any , store : any ) {
153- return handleParamsCommand ( action , put , getUseDb ( store . getState ( ) ) )
156+ const currDb = getCurrentDatabase ( store . getState ( ) )
157+ const onUnsupportedDb = Boolean ( currDb && isSystemOrCompositeDb ( currDb ) )
158+ return handleParamsCommand ( action , put , onUnsupportedDb )
154159 . then ( res => {
155160 const params =
156161 res . type === 'param' ? res . result : getParams ( store . getState ( ) )
@@ -350,15 +355,15 @@ const availableCommands = [
350355 name : 'sysinfo' ,
351356 match : ( cmd : any ) => / ^ s y s i n f o $ / . test ( cmd ) ,
352357 exec ( action : any , put : any , store : any ) {
353- const useDb = getUseDb ( store . getState ( ) )
354- if ( useDb === SYSTEM_DB ) {
358+ const db = getCurrentDatabase ( store . getState ( ) )
359+ if ( db && isSystemOrCompositeDb ( db ) ) {
355360 put (
356361 frames . add ( {
357362 useDb,
358363 ...action ,
359364 type : 'error' ,
360365 error : UnsupportedError (
361- 'The :sysinfo command is not supported while using the system database.'
366+ 'The :sysinfo command is not supported while using the system or a composite database.'
362367 )
363368 } )
364369 )
0 commit comments