From 59010ddda5d69190e6924aec65c4ecee1f568a0b Mon Sep 17 00:00:00 2001 From: Phil Eaton Date: Wed, 6 Apr 2022 09:57:03 -0400 Subject: [PATCH] Misc fixes (#212) * Misc fixes * Add comment * Fix for cancelled panels --- ui/PageList.tsx | 4 ++++ ui/Panel.tsx | 11 +++++++++-- ui/PanelList.tsx | 2 +- ui/app.tsx | 2 +- ui/components/CodeEditor.tsx | 7 +++++++ ui/style.css | 5 +++++ 6 files changed, 27 insertions(+), 4 deletions(-) diff --git a/ui/PageList.tsx b/ui/PageList.tsx index a95edbdbf..9dd498ad5 100644 --- a/ui/PageList.tsx +++ b/ui/PageList.tsx @@ -59,6 +59,10 @@ export function makeReevalPanel( // Important! Just needs to trigger a state reload. updatePanelInternal(panel); + if (panel.resultMeta.exception) { + return; + } + // Re-run all dependent visual panels if (!VISUAL_PANELS.includes(panel.type)) { for (const dep of page.panels) { diff --git a/ui/Panel.tsx b/ui/Panel.tsx index a3edfba69..ae7965d87 100644 --- a/ui/Panel.tsx +++ b/ui/Panel.tsx @@ -306,7 +306,14 @@ export function Panel({ async function evalThis() { if (killable) { await killProcess(); - setLoading(false); + + // Only don't reeval if we think it's already not running. // + // This allows the UI to kill any background running process that + // might have started on a different page or something like that. + if (loading) { + setLoading(false); + return; + } } setLoading(true); @@ -416,7 +423,7 @@ export function Panel({ -