@tagadapay/plugin-sdk 1.0.15 → 1.0.16

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.
@@ -86,11 +86,14 @@ export function useOrderBump(options) {
86
86
  }, [autoPreview, refreshPreview]);
87
87
  // Register refresh function with coordinator and cleanup on unmount
88
88
  useEffect(() => {
89
- refreshCoordinator.registerOrderBumpRefresh(refreshPreview);
90
- return () => {
91
- refreshCoordinator.unregisterOrderBumpRefresh();
92
- };
93
- }, [refreshPreview, refreshCoordinator]);
89
+ // Only register with refresh coordinator if autoPreview is enabled
90
+ if (autoPreview) {
91
+ refreshCoordinator.registerOrderBumpRefresh(refreshPreview);
92
+ return () => {
93
+ refreshCoordinator.unregisterOrderBumpRefresh();
94
+ };
95
+ }
96
+ }, [refreshPreview, refreshCoordinator, autoPreview]);
94
97
  // Calculate current savings
95
98
  const savings = isSelected && preview?.savings ? preview.savings : preview?.savings || null;
96
99
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagadapay/plugin-sdk",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "Modern React SDK for building Tagada Pay plugins",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",