@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.mjs CHANGED
@@ -7231,8 +7231,10 @@ function StoreHomePage({
7231
7231
  const [grouped, setGrouped] = useState(null);
7232
7232
  const [loading, setLoading] = useState(true);
7233
7233
  const [error, setError] = useState(null);
7234
+ const [retryKey, setRetryKey] = useState(0);
7234
7235
  useEffect(() => {
7235
7236
  let cancelled = false;
7237
+ let autoRetryTimer = null;
7236
7238
  async function load() {
7237
7239
  setLoading(true);
7238
7240
  try {
@@ -7246,7 +7248,15 @@ function StoreHomePage({
7246
7248
  setGrouped(res.data.homeGroupedProducts);
7247
7249
  setError(null);
7248
7250
  } catch {
7249
- if (!cancelled) setError("Failed to load store. Please try again.");
7251
+ if (!cancelled) {
7252
+ if (retryKey < 1) {
7253
+ autoRetryTimer = setTimeout(() => {
7254
+ if (!cancelled) setRetryKey(1);
7255
+ }, 2e3);
7256
+ } else {
7257
+ setError("Failed to load store. Please try again.");
7258
+ }
7259
+ }
7250
7260
  } finally {
7251
7261
  if (!cancelled) setLoading(false);
7252
7262
  }
@@ -7254,8 +7264,9 @@ function StoreHomePage({
7254
7264
  load();
7255
7265
  return () => {
7256
7266
  cancelled = true;
7267
+ if (autoRetryTimer) clearTimeout(autoRetryTimer);
7257
7268
  };
7258
- }, [client, compatibleWith]);
7269
+ }, [client, compatibleWith, retryKey]);
7259
7270
  function navigate(path) {
7260
7271
  if (onNavigate) {
7261
7272
  onNavigate(path);
@@ -7413,7 +7424,7 @@ function StoreHomePage({
7413
7424
  "button",
7414
7425
  {
7415
7426
  type: "button",
7416
- onClick: () => window.location.reload(),
7427
+ onClick: () => setRetryKey((k) => k + 1),
7417
7428
  className: "text-sm text-primary hover:underline",
7418
7429
  children: "Retry"
7419
7430
  }