2025-08-10 16:09:15 +02:00
|
|
|
/**
|
2025-08-14 15:08:40 +02:00
|
|
|
* Config Cache Initialization Plugin
|
|
|
|
|
* Simplified config cache initialization
|
2025-08-10 16:09:15 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
export default defineNuxtPlugin({
|
|
|
|
|
name: 'config-cache-init',
|
|
|
|
|
enforce: 'pre', // Run before other plugins
|
|
|
|
|
async setup() {
|
|
|
|
|
// Only run on client side
|
|
|
|
|
if (typeof window === 'undefined') {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Initialize a flag to prevent multiple initializations
|
|
|
|
|
if ((window as any).__configCacheInitialized) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Mark as initialized
|
|
|
|
|
(window as any).__configCacheInitialized = true;
|
|
|
|
|
|
|
|
|
|
// Initialize the config cache structure if not already present
|
|
|
|
|
if (!(window as any).__configCache) {
|
|
|
|
|
(window as any).__configCache = {
|
|
|
|
|
recaptcha: null,
|
|
|
|
|
registration: null,
|
|
|
|
|
recaptchaLoading: false,
|
|
|
|
|
registrationLoading: false,
|
|
|
|
|
recaptchaError: null,
|
|
|
|
|
registrationError: null
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Initialize call history for circuit breaker
|
|
|
|
|
if (!(window as any).__configCallHistory) {
|
|
|
|
|
(window as any).__configCallHistory = {};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|