@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
|
-
|
|
90
|
-
|
|
91
|
-
refreshCoordinator.
|
|
92
|
-
|
|
93
|
-
|
|
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 {
|