mirror of
https://github.com/svemagie/blog-eleventy-indiekit.git
synced 2026-05-14 22:48:50 +02:00
fix: dispatch auth event on window for Alpine.js compatibility
Alpine's .window modifier listens on window, not document. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -32,7 +32,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function dispatch(loggedIn) {
|
function dispatch(loggedIn) {
|
||||||
document.dispatchEvent(new CustomEvent('indiekit:auth', { detail: { loggedIn: loggedIn } }));
|
window.dispatchEvent(new CustomEvent('indiekit:auth', { detail: { loggedIn: loggedIn } }));
|
||||||
if (loggedIn) {
|
if (loggedIn) {
|
||||||
document.body.setAttribute('data-indiekit-auth', 'true');
|
document.body.setAttribute('data-indiekit-auth', 'true');
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user