@cshah18/sdk 3.0.4 → 3.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cobuy-sdk.esm.js
CHANGED
|
@@ -2633,7 +2633,6 @@ class WidgetRoot {
|
|
|
2633
2633
|
}
|
|
2634
2634
|
/** Fetch latest group data and re-render containers */
|
|
2635
2635
|
async refreshGroupDataFromRealtime() {
|
|
2636
|
-
console.log("request group data realtime callledddd");
|
|
2637
2636
|
// Debounce rapid refreshes to prevent loops and reduce API load
|
|
2638
2637
|
const now = Date.now();
|
|
2639
2638
|
if (now - this.lastGroupDataRefreshTime < this.GROUP_REFRESH_DEBOUNCE) {
|
|
@@ -2658,6 +2657,9 @@ class WidgetRoot {
|
|
|
2658
2657
|
this.groupFulfilled = true;
|
|
2659
2658
|
}
|
|
2660
2659
|
}
|
|
2660
|
+
else {
|
|
2661
|
+
this.groupFulfilled = false;
|
|
2662
|
+
}
|
|
2661
2663
|
this.refreshRenderedContainers();
|
|
2662
2664
|
}
|
|
2663
2665
|
catch (error) {
|
|
@@ -3048,7 +3050,6 @@ class WidgetRoot {
|
|
|
3048
3050
|
let groupData = null;
|
|
3049
3051
|
if (this.apiClient) {
|
|
3050
3052
|
rewardData = await this.fetchRewardWithRetry(options.productId);
|
|
3051
|
-
console.log("from renderrrr");
|
|
3052
3053
|
groupData = await this.fetchPrimaryGroup(options.productId);
|
|
3053
3054
|
this.currentGroupData = groupData;
|
|
3054
3055
|
this.currentGroupId = (groupData === null || groupData === void 0 ? void 0 : groupData.id) || null;
|
|
@@ -3305,7 +3306,6 @@ class WidgetRoot {
|
|
|
3305
3306
|
*/
|
|
3306
3307
|
async fetchPrimaryGroup(productId) {
|
|
3307
3308
|
var _a;
|
|
3308
|
-
console.log("fetch primary group called");
|
|
3309
3309
|
if (!this.apiClient) {
|
|
3310
3310
|
return null;
|
|
3311
3311
|
}
|
|
@@ -8951,9 +8951,7 @@ class CoBuy {
|
|
|
8951
8951
|
const ref = window.localStorage.getItem(key);
|
|
8952
8952
|
if (ref) {
|
|
8953
8953
|
this.logger.debug(`[SDK] Retrieved checkout reference via prefix: ${key}`);
|
|
8954
|
-
const parsedGroupId = key.startsWith(`${basePrefix}_`)
|
|
8955
|
-
? key.substring(basePrefix.length + 1)
|
|
8956
|
-
: null;
|
|
8954
|
+
const parsedGroupId = key.startsWith(`${basePrefix}_`) ? key.substring(basePrefix.length + 1) : null;
|
|
8957
8955
|
return { key, checkoutRef: ref, groupId: parsedGroupId };
|
|
8958
8956
|
}
|
|
8959
8957
|
}
|
|
@@ -9374,7 +9372,6 @@ class CoBuy {
|
|
|
9374
9372
|
const pid = typeof w.getProductId === "function" ? w.getProductId() : null;
|
|
9375
9373
|
if (!productId || pid === productId) {
|
|
9376
9374
|
if (typeof w.requestRefresh === "function") {
|
|
9377
|
-
console.log("calling refresshh now");
|
|
9378
9375
|
refreshPromises.push(w.requestRefresh());
|
|
9379
9376
|
}
|
|
9380
9377
|
}
|