@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
- // ✅ IMPORTANT: Trigger auto-save for manual address typing
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
- 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 {
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * Client-side token storage utilities
4
4
  */
5
- const TOKEN_KEY = 'tagada_cms_token';
5
+ const TOKEN_KEY = 'cms_token';
6
6
  /**
7
7
  * Set the CMS token in localStorage
8
8
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagadapay/plugin-sdk",
3
- "version": "1.0.14",
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",