@tagadapay/plugin-sdk 1.0.14 → 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.
|
@@ -317,10 +317,7 @@ export function useAddress(options = {}) {
|
|
|
317
317
|
if (isAddressSelected) {
|
|
318
318
|
setIsAddressSelected(false);
|
|
319
319
|
}
|
|
320
|
-
|
|
321
|
-
// This ensures that manual typing (without Google Places selection) is saved
|
|
322
|
-
triggerAutoSave('manual');
|
|
323
|
-
}, [isAddressSelected, triggerAutoSave]);
|
|
320
|
+
}, [isAddressSelected]);
|
|
324
321
|
// Sync addressInputValue with external changes
|
|
325
322
|
useEffect(() => {
|
|
326
323
|
const currentAddress = fields.address1.value;
|
|
@@ -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 {
|