@@ -59,6 +59,7 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
5959 } )
6060
6161 const [ clearConsole , setClearConsole ] = useState ( false )
62+ const [ isVM , setIsVM ] = useState ( false )
6263 const [ paste , setPaste ] = useState ( false )
6364 const [ storage , setStorage ] = useState < any > ( null )
6465 const [ autoCompletState , setAutoCompleteState ] = useState ( {
@@ -98,6 +99,10 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
9899 }
99100
100101 useEffect ( ( ) => {
102+ props . plugin . on ( 'network' , 'providerChanged' , ( provider ) => {
103+ setIsVM ( provider . startsWith ( 'vm-' ) )
104+ } )
105+
101106 props . onReady ( {
102107 logHtml : ( html ) => {
103108 scriptRunnerDispatch ( {
@@ -603,11 +608,22 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
603608 < CustomTooltip placement = "top" tooltipId = "terminalClear" tooltipClasses = "text-nowrap" tooltipText = { < FormattedMessage id = "terminal.pendingTransactions" /> } >
604609 < div className = "mx-2" > 0</ div >
605610 </ CustomTooltip >
606- < div className = "h-80 mx-3 align-items-center remix_ui_terminal_listenOnNetwork custom-control custom-checkbox" >
607- < CustomTooltip placement = "top" tooltipId = "terminalClear" tooltipClasses = "text-nowrap" tooltipText = { intl . formatMessage ( { id : 'terminal.listenTitle' } ) } >
608- < input className = "custom-control-input" id = "listenNetworkCheck" onChange = { listenOnNetwork } type = "checkbox" />
609- </ CustomTooltip >
610- < CustomTooltip placement = "top" tooltipId = "terminalClear" tooltipClasses = "text-nowrap" tooltipText = { intl . formatMessage ( { id : 'terminal.listenTitle' } ) } >
611+ < CustomTooltip
612+ placement = "top"
613+ tooltipId = "terminalClear"
614+ tooltipClasses = "text-nowrap"
615+ tooltipText = { intl . formatMessage ( { id : isVM ? 'terminal.listenVM' : 'terminal.listenTitle' } ) }
616+ >
617+ < div className = "h-80 mx-3 align-items-center remix_ui_terminal_listenOnNetwork custom-control custom-checkbox" >
618+ < CustomTooltip placement = "top" tooltipId = "terminalClear" tooltipClasses = "text-nowrap" tooltipText = { intl . formatMessage ( { id : 'terminal.listenTitle' } ) } >
619+ < input
620+ className = "custom-control-input"
621+ id = "listenNetworkCheck"
622+ onChange = { listenOnNetwork }
623+ type = "checkbox"
624+ disabled = { isVM }
625+ />
626+ </ CustomTooltip >
611627 < label
612628 className = "form-check-label custom-control-label text-nowrap"
613629 style = { { paddingTop : '0.125rem' } }
@@ -616,8 +632,8 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
616632 >
617633 < FormattedMessage id = "terminal.listen" />
618634 </ label >
619- </ CustomTooltip >
620- </ div >
635+ </ div >
636+ </ CustomTooltip >
621637 < div className = "remix_ui_terminal_search d-flex align-items-center h-100" >
622638 < i className = "remix_ui_terminal_searchIcon d-flex align-items-center justify-content-center fas fa-search bg-light" aria-hidden = "true" > </ i >
623639 < input
0 commit comments