mirror of
https://github.com/uthvah/sync-embeds.git
synced 2026-07-22 06:43:40 +00:00
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:
parent
47e058331d
commit
2651ac21d8
1 changed files with 9 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue