Add cleanup before rendering section not found error

Removes the loading modal before rendering an error for a missing section.
This commit is contained in:
Verity 2026-02-17 21:58:10 +00:00 committed by GitHub
parent 47e058331d
commit 2651ac21d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -281,7 +281,15 @@ class EmbedManager {
const sectionInfo = this.viewportController.findSectionBounds(content, section);
if (sectionInfo.startLine === -1) {
this.renderError(embedContainer.parentElement, `Section not found: ${section}`, false);
// Cleanup
embedContainer.empty();
embedContainer.removeClass('sync-embed-loading');
embedContainer.style.height = 'auto';
embedContainer.style.minHeight = '0';
// Render the error
this.renderError(embedContainer, `Section not found: ${section}`, false);
leaf.detach();
return;
}