@@ -20,9 +20,10 @@ export function RecorderUI(props: RecorderProps) {
2020 }
2121
2222 useEffect ( ( ) => {
23- if ( props . currentFile && props . currentFile . endsWith ( '.json' ) ) setEnableRunButton ( false )
24- else setEnableRunButton ( true )
25- } , [ props . currentFile ] )
23+ if ( props . txCount > 0 && props . currentFile && props . currentFile . endsWith ( '.json' ) ) setEnableRunButton ( true )
24+ else setEnableRunButton ( false )
25+ console . log ( 'props.txCount' , props . txCount )
26+ } , [ props . currentFile , props . txCount ] )
2627
2728 const toggleClass = ( ) => {
2829 setToggleExpander ( ! toggleExpander )
@@ -47,7 +48,7 @@ export function RecorderUI(props: RecorderProps) {
4748 tooltipText = { < FormattedMessage id = "udapp.transactionsCountTooltip" /> }
4849 >
4950 < div className = "ml-2 badge badge-pill badge-primary text-center" style = { { cursor :"default" } } data-title = "The number of recorded transactions" >
50- { props . count }
51+ { props . txCount }
5152 </ div >
5253 </ CustomTooltip >
5354 < CustomTooltip
@@ -96,18 +97,18 @@ export function RecorderUI(props: RecorderProps) {
9697 tooltipClasses = "text-nowrap"
9798 tooltipId = "remixUdappTransactionSavetooltip"
9899 tooltipText = {
99- props . count === 0
100+ props . txCount === 0
100101 ? intl . formatMessage ( { id : 'udapp.transactionSaveTooltip1' } )
101- : props . count === 1
102- ? intl . formatMessage ( { id : 'udapp.transactionSaveTooltip2' } , { count : props . count } )
103- : intl . formatMessage ( { id : 'udapp.transactionSaveTooltip3' } , { count : props . count } )
102+ : props . txCount === 1
103+ ? intl . formatMessage ( { id : 'udapp.transactionSaveTooltip2' } , { count : props . txCount } )
104+ : intl . formatMessage ( { id : 'udapp.transactionSaveTooltip3' } , { count : props . txCount } )
104105 }
105106 >
106107 < button
107108 className = "btn btn-sm btn-secondary savetransaction udapp_recorder"
108- disabled = { props . count === 0 ? true : false }
109+ disabled = { props . txCount === 0 ? true : false }
109110 onClick = { triggerRecordButton }
110- style = { { pointerEvents : props . count === 0 ? 'none' : 'auto' } }
111+ style = { { pointerEvents : props . txCount === 0 ? 'none' : 'auto' } }
111112 id = "udappRecorderSave"
112113 >
113114 < FormattedMessage id = "udapp.save" />
@@ -117,9 +118,9 @@ export function RecorderUI(props: RecorderProps) {
117118 < button
118119 className = { enableRunButton ? "btn btn-sm btn-secondary runtransaction udapp_runTxs" : "btn btn-sm btn-secondary runtransaction udapp_runTxs disabled" }
119120 data-id = "runtransaction"
120- disabled = { enableRunButton }
121+ disabled = { ! enableRunButton }
121122 onClick = { handleClickRunButton }
122- style = { { pointerEvents : enableRunButton ? 'none' : 'auto' } }
123+ style = { { pointerEvents : ! enableRunButton ? 'none' : 'auto' } }
123124 id = "udappRecorderRun"
124125 >
125126 < FormattedMessage id = "udapp.run" />
0 commit comments