Skip to content

Commit d3c4b6e

Browse files
committed
Mark Python output as up-to-date even if an error occurs.
1 parent 2ff1cc7 commit d3c4b6e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/app.tsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ function AppContent() {
8383
const [pythonOutput, setPythonOutput] = useState<TerminalChunk[] | null>(null);
8484
const [pythonOutputWasNull, setPythonOutputWasNull] = useState(true);
8585
const [waveforms, setWaveforms] = useState<object | null>(null);
86+
const [outputOutOfDate, setOutputOutOfDate] = useState(false);
8687
const [productsOutOfDate, setProductsOutOfDate] = useState(false);
8788
const [rtlilProduct, setRtlilProduct] = useState<string | null>(null);
8889
const [verilogProduct, setVerilogProduct] = useState<string | null>(null);
@@ -152,6 +153,7 @@ function AppContent() {
152153
}
153154
} finally {
154155
setRunning(false);
156+
setOutputOutOfDate(false);
155157
}
156158
}
157159

@@ -323,19 +325,21 @@ function AppContent() {
323325

324326
const prevAmaranthSource = useRef(amaranthSource);
325327
useEffect(() => {
326-
if (amaranthSource != prevAmaranthSource.current)
328+
if (amaranthSource != prevAmaranthSource.current) {
329+
setOutputOutOfDate(true);
327330
setProductsOutOfDate(true);
331+
}
328332
prevAmaranthSource.current = amaranthSource;
329333
}, [amaranthSource]);
330334

331335
if (pythonOutput !== null)
332336
tabsWithPanels.push(tabAndPanel({
333337
key: 'python-output',
334338
title: 'Python Output',
335-
titleStyle: productsOutOfDate ? { textDecoration: 'line-through' } : {},
339+
titleStyle: outputOutOfDate ? { textDecoration: 'line-through' } : {},
336340
content:
337341
<Box sx={{ display: 'flex', flexDirection: 'column', height: '100%' }}>
338-
{productsOutOfDate && <Alert variant='soft' color='warning' sx={{ borderRadius: 0 }}>
342+
{outputOutOfDate && <Alert variant='soft' color='warning' sx={{ borderRadius: 0 }}>
339343
The Python output is out of date. Run the program again to refresh it.
340344
</Alert>}
341345
<Box

0 commit comments

Comments
 (0)