From eb47e726eef691ad281651097ed965fe689d9464 Mon Sep 17 00:00:00 2001 From: "davidzagi93@gmail.com" Date: Wed, 25 Aug 2021 08:40:38 +0100 Subject: [PATCH] logHtml error --- .../terminal/src/lib/remix-ui-terminal.tsx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx index da6bc699a6..6bb882cf0b 100644 --- a/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx +++ b/libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx @@ -129,12 +129,12 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { if (output) scriptRunnerDispatch({ type: 'script', payload: { message: '5' } }) }) }, { activate: true }, dispatch) - }, [props.thisState.autoCompletePopup, autoCompletState.text, props.logHtml]) + }, [props.thisState.autoCompletePopup, autoCompletState.text]) useEffect(() => { scrollToBottom() console.log({ messagesEndRef: messagesEndRef.current }, ' onScroll') - }, [newstate.journalBlocks.length]) + }, [newstate.journalBlocks.length, props.logHtml.length]) function execute (file, cb) { console.log('called execute scriptRunner') @@ -261,8 +261,9 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { setAutoCompleteState(prevState => ({ ...prevState, activeSuggestion: 0, showSuggestions: false, userInput: Object.keys(autoCompletState.data._options[0]).toString() })) } else { console.log(autoCompletState.activeSuggestion, 'autoCompletState.userInput.length') - setAutoCompleteState(prevState => ({ ...prevState, activeSuggestion: 0, showSuggestions: false, userInput: Object.keys(autoCompletState.data._options[autoCompletState.activeSuggestion]).toString() })) + setAutoCompleteState(prevState => ({ ...prevState, activeSuggestion: 0, showSuggestions: false, userInput: inputEl.current.value })) } + console.log({ autoCompletState }, 'autoCompletState') } if (event.which === 13 && !autoCompletState.showSuggestions) { if (event.ctrlKey) { // @@ -883,11 +884,11 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => { return (
{renderKnownTransactions(trans.tx, trans.receipt, trans.resolvedData, trans.logs, index)}
) }) } else { - return ( -
- {x.message} -
- ) + return x.message.map((x, i) => { + return ( +
{ x }
+ ) + }) } })}