fix(preview): stop loader re-appearing when rendered.js is missing

When rendered is null, render() was setting loading.style.display='flex'
before returning — overriding the hide already done in the init error
branch. Now render() silently returns, leaving init to handle the error.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
KenanZhuandClaude Opus 4.8 committed 2026-06-04 14:36:42 +08:00
1 parent dc2d9de2a4
commit dc602a7dde
1 file changed
+1 -1
+1 -1
View File
@@ -183,7 +183,7 @@ function transform(html, mode) {
function render() {
const frame = document.getElementById('preview-frame');
const loading = document.getElementById('loading');
if(!rendered) { loading.style.display='flex'; frame.style.display='none'; return; }
if(!rendered) return; // no data yet — init handles the error display
frame.style.display = 'none';
loading.style.display = 'flex';