fix: move init guard to prevent race conditions in email-templates
The initialization guard was placed after the await I18n.loadModule() call, which could cause race conditions if Alpine calls init() multiple times before the guard is set. This aligns with the pattern used by other pages. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -57,12 +57,13 @@ function emailTemplatesPage() {
|
||||
|
||||
// Lifecycle
|
||||
async init() {
|
||||
// Load i18n translations
|
||||
await I18n.loadModule('messaging');
|
||||
|
||||
// Guard against duplicate initialization
|
||||
if (window._adminEmailTemplatesInitialized) return;
|
||||
window._adminEmailTemplatesInitialized = true;
|
||||
|
||||
// Load i18n translations
|
||||
await I18n.loadModule('messaging');
|
||||
|
||||
await this.loadData();
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user