feat: add console logging for image loading and product data fetching in Product and ProductDetailPage components for improved debugging

This commit is contained in:
sebseb7
2025-07-23 08:41:26 +02:00
parent 602324b1fe
commit 1c777f8daa
2 changed files with 5 additions and 2 deletions

View File

@@ -41,6 +41,7 @@ class Product extends Component {
loadImage = (bildId) => { loadImage = (bildId) => {
console.log('loadImagevisSocket', bildId);
window.socketManager.emit('getPic', { bildId, size:'small' }, (res) => { window.socketManager.emit('getPic', { bildId, size:'small' }, (res) => {
if(res.success){ if(res.success){
window.smallPicCache[bildId] = URL.createObjectURL(new Blob([res.imageBuffer], { type: 'image/jpeg' })); window.smallPicCache[bildId] = URL.createObjectURL(new Blob([res.imageBuffer], { type: 'image/jpeg' }));

View File

@@ -133,6 +133,7 @@ class ProductDetailPage extends Component {
} }
// Fetch image from server // Fetch image from server
console.log('loadKomponentImage', bildId);
window.socketManager.emit('getPic', { bildId, size: 'small' }, (res) => { window.socketManager.emit('getPic', { bildId, size: 'small' }, (res) => {
if (res.success) { if (res.success) {
// Cache the image // Cache the image
@@ -227,6 +228,7 @@ class ProductDetailPage extends Component {
} }
})); }));
console.log('loadKomponent', id, count);
window.socketManager.emit( window.socketManager.emit(
"getProductView", "getProductView",
{ articleId: id }, { articleId: id },
@@ -338,7 +340,7 @@ class ProductDetailPage extends Component {
} }
loadProductData = () => { loadProductData = () => {
console.log('loadProductData', this.props.seoName);
window.socketManager.emit( window.socketManager.emit(
"getProductView", "getProductView",
{ seoName: this.props.seoName }, { seoName: this.props.seoName },
@@ -408,7 +410,7 @@ class ProductDetailPage extends Component {
} }
} else { } else {
// Not in cache, fetch from server // Not in cache, fetch from server
console.log('getAttributePicture', cacheKey);
window.socketManager.emit( window.socketManager.emit(
"getAttributePicture", "getAttributePicture",
{ id: cacheKey }, { id: cacheKey },