hey-pharmacist-ecommerce 1.1.22 → 1.1.23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hey-pharmacist-ecommerce",
3
- "version": "1.1.22",
3
+ "version": "1.1.23",
4
4
  "description": "Production-ready, multi-tenant e‑commerce UI + API adapter for Next.js with auth, carts, checkout, orders, theming, and pharmacist-focused UX.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -20,9 +20,9 @@ interface EcommerceProviderProps {
20
20
  }
21
21
 
22
22
  export function EcommerceProvider({ config, children, withToaster = true, basePath = '' }: EcommerceProviderProps) {
23
- useEffect(() => {
24
- // Initialize API adapter with store configuration
25
- // This sets up the real backend APIs with proper authentication and store ID
23
+ // Initialize API adapter with store configuration synchronously
24
+ // This ensures setting up the real backend APIs before children render and fire their effects
25
+ React.useMemo(() => {
26
26
  initializeApiAdapter(config);
27
27
  }, [config]);
28
28
 
@@ -31,19 +31,19 @@ export function EcommerceProvider({ config, children, withToaster = true, basePa
31
31
  );
32
32
  return (
33
33
  <QueryClientProvider client={client}>
34
- <ThemeProvider config={config}>
35
- <BasePathProvider basePath={basePath}>
36
- <AuthProvider>
37
- <NotificationProvider>
38
- <CartProvider>
39
- <WishlistProvider>
40
- {children}
41
- </WishlistProvider>
42
- </CartProvider>
43
- </NotificationProvider>
44
- </AuthProvider>
45
- </BasePathProvider>
46
- </ThemeProvider>
34
+ <ThemeProvider config={config}>
35
+ <BasePathProvider basePath={basePath}>
36
+ <AuthProvider>
37
+ <NotificationProvider>
38
+ <CartProvider>
39
+ <WishlistProvider>
40
+ {children}
41
+ </WishlistProvider>
42
+ </CartProvider>
43
+ </NotificationProvider>
44
+ </AuthProvider>
45
+ </BasePathProvider>
46
+ </ThemeProvider>
47
47
  </QueryClientProvider>
48
48
  );
49
49
  }