prevent double initialization (Alpine.js may call x-init twice in some cases)

This commit is contained in:
Gamosoft 2025-12-10 09:41:54 +01:00
parent b97eb70287
commit 670a6b22d7
1 changed files with 4 additions and 0 deletions

View File

@ -281,6 +281,10 @@ function noteApp() {
// Initialize app
async init() {
// Prevent double initialization (Alpine.js may call x-init twice in some cases)
if (window.__noteapp_initialized) return;
window.__noteapp_initialized = true;
// Store global reference for native event handlers in x-html content
window.$root = this;