diff --git a/src/services/SocketManager.js b/src/services/SocketManager.js
index 70ad7fb..9b2fbe1 100644
--- a/src/services/SocketManager.js
+++ b/src/services/SocketManager.js
@@ -28,17 +28,13 @@ class SocketManager {
}
this.pendingListeners.get(event).add(callback);
- // If not already connecting, initiate connection
- if (!this.connectPromise) {
- this.connect();
- }
-
// Register the listener now, it will receive events once connected
this.socket.on(event, callback);
}
off(event, callback) {
// Remove from socket listeners
+ console.log('off', event, callback);
this.socket.off(event, callback);
// Remove from pending listeners if present
diff --git a/webpack.config.js b/webpack.config.js
index 9b1e71d..4ed99f1 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -168,13 +168,19 @@ class InlineCssPlugin {
// Extract current page path from the HTML to determine which images to preload
const htmlContent = data.html;
- const isProductPage = htmlContent.includes('/Artikel/') || htmlContent.includes('product-detail');
- const isSpecialPage = htmlContent.includes('/impressum') || htmlContent.includes('/datenschutz') ||
- htmlContent.includes('/agb') || htmlContent.includes('/profile') ||
- htmlContent.includes('/admin') || htmlContent.includes('/404') ||
- htmlContent.includes('/widerrufsrecht') || htmlContent.includes('/batteriegesetzhinweise');
+ const isProductPage = htmlContent.includes('ProductDetailPage') ||
+ htmlContent.includes('/Artikel/') ||
+ htmlContent.includes('product-detail');
+ const isSpecialPage = htmlContent.includes('/impressum') ||
+ htmlContent.includes('/datenschutz') ||
+ htmlContent.includes('/agb') ||
+ htmlContent.includes('/profile') ||
+ htmlContent.includes('/admin') ||
+ htmlContent.includes('/404') ||
+ htmlContent.includes('/widerrufsrecht') ||
+ htmlContent.includes('/batteriegesetzhinweise');
- // Define critical images array
+ // Define critical images array - only preload these on pages that actually use them
const criticalImages = [
'/assets/images/filiale1.jpg',
'/assets/images/filiale2.jpg',
@@ -186,9 +192,10 @@ class InlineCssPlugin {
// Only preload navigation images for main pages (home, categories, aktionen, filiale)
if (!isProductPage && !isSpecialPage) {
- criticalImages.forEach(imagePath => {
- imagePreloads += `\n`;
- });
+ // Add the as="image" attribute to ensure proper preloading
+ criticalImages.forEach(imagePath => {
+ imagePreloads += `\n`;
+ });
}
// Add inlined CSS to head