@numueg/theme-sdk 0.6.0 → 0.6.1

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.cjs CHANGED
@@ -9,7 +9,7 @@ var MAX_BLOCK_DEPTH = 5;
9
9
 
10
10
  // src/validation/index.ts
11
11
  var THEME_CONTRACT_VERSION = 1;
12
- var SDK_VERSION = "0.6.0" ;
12
+ var SDK_VERSION = "0.6.1" ;
13
13
  var REQUIRED_TEMPLATES = [
14
14
  "home",
15
15
  "product",
@@ -1939,7 +1939,7 @@ function NuMuProvider({
1939
1939
  const [cart, setCart] = react.useState(
1940
1940
  initialCart || { ...EMPTY_CART, currency: store.currency }
1941
1941
  );
1942
- const [loading, setLoading] = react.useState(false);
1942
+ const [loading, setLoading] = react.useState(!initialCart);
1943
1943
  const [locale, setLocale] = react.useState(() => {
1944
1944
  if (initialLocale) return initialLocale;
1945
1945
  if (typeof document !== "undefined") {
@@ -2096,6 +2096,8 @@ function NuMuProvider({
2096
2096
  setCart(normalizeCartFromServer(data));
2097
2097
  }
2098
2098
  } catch {
2099
+ } finally {
2100
+ if (!cancelled) setLoading(false);
2099
2101
  }
2100
2102
  })();
2101
2103
  return () => {