Restored to '20442f595c8df2c8347249ade7f015b7ae566474'

Replit-Restored-To: 20442f595c8df2c8347249ade7f015b7ae566474
This commit is contained in:
pac7
2025-09-21 16:31:10 +00:00
committed by pacnpal
parent a75e6a2098
commit 988c2b2f06
7 changed files with 16 additions and 654 deletions

View File

@@ -375,8 +375,6 @@ Alpine.data('authModal', (defaultMode = 'login') => ({
this.resetForms();
}
});
// No need for event listeners since x-init handles global exposure
},
async fetchSocialProviders() {
@@ -620,44 +618,6 @@ Alpine.store('toast', {
});
console.log('All Alpine.js components registered successfully');
// Ensure global authModal is available immediately
if (typeof window !== 'undefined') {
// Create a simple proxy that will find the authModal component when called
window.authModal = {
show: (mode = 'login') => {
console.log('Attempting to show auth modal:', mode);
// Find the authModal component in the DOM
const modalEl = document.querySelector('[x-data*="authModal"]');
if (modalEl && modalEl._x_dataStack && modalEl._x_dataStack[0]) {
const component = modalEl._x_dataStack[0];
if (component.show && typeof component.show === 'function') {
component.show(mode);
console.log('Auth modal opened successfully');
return;
}
}
// Fallback: try to find any component with a show method
const elements = document.querySelectorAll('[x-data]');
for (let el of elements) {
if (el._x_dataStack) {
for (let stack of el._x_dataStack) {
if (stack.show && stack.mode !== undefined) {
stack.show(mode);
console.log('Auth modal opened via fallback method');
return;
}
}
}
}
console.error('Could not find authModal component to open');
}
};
console.log('Global authModal proxy created');
}
}
// Try multiple registration approaches