@burdenoff/website-sdk 2026.726.4 → 2026.727.2
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/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +14 -3
- package/dist/index.mjs.map +1 -1
- package/dist/store/index.js +14 -3
- package/dist/store/index.js.map +1 -1
- package/dist/store/index.mjs +14 -3
- package/dist/store/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/store/index.js
CHANGED
|
@@ -842,8 +842,10 @@ function StoreHomePage({
|
|
|
842
842
|
const [grouped, setGrouped] = React.useState(null);
|
|
843
843
|
const [loading, setLoading] = React.useState(true);
|
|
844
844
|
const [error, setError] = React.useState(null);
|
|
845
|
+
const [retryKey, setRetryKey] = React.useState(0);
|
|
845
846
|
React.useEffect(() => {
|
|
846
847
|
let cancelled = false;
|
|
848
|
+
let autoRetryTimer = null;
|
|
847
849
|
async function load() {
|
|
848
850
|
setLoading(true);
|
|
849
851
|
try {
|
|
@@ -857,7 +859,15 @@ function StoreHomePage({
|
|
|
857
859
|
setGrouped(res.data.homeGroupedProducts);
|
|
858
860
|
setError(null);
|
|
859
861
|
} catch {
|
|
860
|
-
if (!cancelled)
|
|
862
|
+
if (!cancelled) {
|
|
863
|
+
if (retryKey < 1) {
|
|
864
|
+
autoRetryTimer = setTimeout(() => {
|
|
865
|
+
if (!cancelled) setRetryKey(1);
|
|
866
|
+
}, 2e3);
|
|
867
|
+
} else {
|
|
868
|
+
setError("Failed to load store. Please try again.");
|
|
869
|
+
}
|
|
870
|
+
}
|
|
861
871
|
} finally {
|
|
862
872
|
if (!cancelled) setLoading(false);
|
|
863
873
|
}
|
|
@@ -865,8 +875,9 @@ function StoreHomePage({
|
|
|
865
875
|
load();
|
|
866
876
|
return () => {
|
|
867
877
|
cancelled = true;
|
|
878
|
+
if (autoRetryTimer) clearTimeout(autoRetryTimer);
|
|
868
879
|
};
|
|
869
|
-
}, [client, compatibleWith]);
|
|
880
|
+
}, [client, compatibleWith, retryKey]);
|
|
870
881
|
function navigate(path) {
|
|
871
882
|
if (onNavigate) {
|
|
872
883
|
onNavigate(path);
|
|
@@ -1024,7 +1035,7 @@ function StoreHomePage({
|
|
|
1024
1035
|
"button",
|
|
1025
1036
|
{
|
|
1026
1037
|
type: "button",
|
|
1027
|
-
onClick: () =>
|
|
1038
|
+
onClick: () => setRetryKey((k) => k + 1),
|
|
1028
1039
|
className: "text-sm text-primary hover:underline",
|
|
1029
1040
|
children: "Retry"
|
|
1030
1041
|
}
|