Skip to content

Commit

Permalink
Ignore empty brain config
Browse files Browse the repository at this point in the history
  • Loading branch information
hvarg committed Apr 4, 2024
1 parent e6265cd commit 09566de
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/files/outputs/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const renderOptionalButtons = (cur: TriggeredLineOfInquiry) => {

return (<Fragment>
{!!values['_SHINY_LOG_'] && (<ShinyModal shinyLog={values['_SHINY_LOG_']}/>)}
{!!values['_BRAIN_VISUALIZATION_'] && (<BrainModal brainCfg={values['_BRAIN_VISUALIZATION_']}/>)}
{!!values['_BRAIN_VISUALIZATION_'] && values['_BRAIN_VISUALIZATION_'] !== "[]\n" && (<BrainModal brainCfg={values['_BRAIN_VISUALIZATION_']}/>)}
</Fragment>);
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/modal/BrainModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const BrainModal = ({brainCfg: brainCfgTxt, iconOnly=true} : BrainModalPr

useEffect(() => {
if (brainCfgTxt && open) {
if (brainCfgTxt.startsWith('[')) {
if (brainCfgTxt !== "[]\n" && brainCfgTxt.startsWith('[')) {
let cfg: BrainCfgItem[] = JSON.parse(brainCfgTxt.replaceAll('\n', ' ').replaceAll('\t', ''));
setBrainCfg(cfg);
} else {
Expand Down

0 comments on commit 09566de

Please sign in to comment.