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