Skip to content

Commit 48512ce

Browse files
committed
this in callback is fixed
see lightpanda-io/zig-js-runtime#211
1 parent d7e20fd commit 48512ce

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

public/campfire-commerce/script.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,8 @@
77
detailsXHR.open('GET', document.URL + 'json/product.json');
88
detailsXHR.responseType = 'json';
99
detailsXHR.onload = function() {
10-
// blocked by https://github.com/lightpanda-io/jsruntime-lib/issues/211
11-
// if (this.status === 200) {
12-
// updateProductInfo(this.response);
13-
// }
14-
if (detailsXHR.status === 200) {
15-
updateProductInfo(detailsXHR.response);
10+
if (this.status === 200) {
11+
updateProductInfo(this.response);
1612
}
1713
};
1814
detailsXHR.send();
@@ -23,12 +19,8 @@ detailsXHR.open('GET', document.URL + 'json/product.json');
2319
reviewsXHR.open('GET', document.URL + 'json/reviews.json');
2420
reviewsXHR.responseType = 'json';
2521
reviewsXHR.onload = function() {
26-
// blocked by https://github.com/lightpanda-io/jsruntime-lib/issues/211
27-
// if (this.status === 200) {
28-
// updateReviews(this.response);
29-
// }
30-
if (reviewsXHR.status === 200) {
31-
updateReviews(reviewsXHR.response);
22+
if (this.status === 200) {
23+
updateReviews(this.response);
3224
}
3325
};
3426
reviewsXHR.send();

0 commit comments

Comments
 (0)