7973ee9ba8ec60e0bd3458a2e16d6b3f51da7d48
The template-load sequence (clear canvas -> add components -> add pages -> apply header/footer) ran as a chain of setTimeout callbacks, but onClose() fired synchronously right after kicking it off. The modal disappeared immediately, so "Loading..." never had a chance to show, and the staged mutations kept running against a dialog the caller had already dismissed. Convert the staged steps to async/await (a promise-based `wait()` replaces the setTimeout chaining) and only call onClose() in a finally block once the whole sequence has settled. Add a mountedRef guard so the trailing setLoading(false) is skipped if the component happens to unmount mid-sequence. End result (pages/header/footer/ design applied) is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Description
Visual drag-and-drop website builder using GrapesJS
Languages
TypeScript
61.2%
HTML
17.1%
JavaScript
17%
CSS
3.6%
PHP
0.8%
Other
0.3%