From 48512ce9f7b3227af87ee6d8bf94d39b81d0ddcf Mon Sep 17 00:00:00 2001 From: Pierre Tachoire Date: Wed, 4 Dec 2024 09:12:45 +0100 Subject: [PATCH] this in callback is fixed see https://github.com/lightpanda-io/zig-js-runtime/issues/211 --- public/campfire-commerce/script.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/public/campfire-commerce/script.js b/public/campfire-commerce/script.js index 9ce4e1c..e28c347 100644 --- a/public/campfire-commerce/script.js +++ b/public/campfire-commerce/script.js @@ -7,12 +7,8 @@ detailsXHR.open('GET', document.URL + 'json/product.json'); detailsXHR.responseType = 'json'; detailsXHR.onload = function() { - // blocked by https://github.com/lightpanda-io/jsruntime-lib/issues/211 - // if (this.status === 200) { - // updateProductInfo(this.response); - // } - if (detailsXHR.status === 200) { - updateProductInfo(detailsXHR.response); + if (this.status === 200) { + updateProductInfo(this.response); } }; detailsXHR.send(); @@ -23,12 +19,8 @@ detailsXHR.open('GET', document.URL + 'json/product.json'); reviewsXHR.open('GET', document.URL + 'json/reviews.json'); reviewsXHR.responseType = 'json'; reviewsXHR.onload = function() { - // blocked by https://github.com/lightpanda-io/jsruntime-lib/issues/211 - // if (this.status === 200) { - // updateReviews(this.response); - // } - if (reviewsXHR.status === 200) { - updateReviews(reviewsXHR.response); + if (this.status === 200) { + updateReviews(this.response); } }; reviewsXHR.send();