@funnelsgrove/payments 0.7.11 → 0.7.12

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.
@@ -111,16 +111,18 @@ export function SolidgateCheckoutDialog({ open, request, customerEmail, checkout
111
111
  const checkoutAnalyticsRef = useRef(checkoutAnalytics);
112
112
  const closeButtonRef = useRef(null);
113
113
  const copyRef = useRef(copy);
114
+ const onCloseRef = useRef(onClose);
114
115
  const onErrorRef = useRef(onError);
115
116
  const onStateChangeRef = useRef(onStateChange);
116
117
  const onSuccessRef = useRef(onSuccess);
117
118
  useEffect(() => {
118
119
  checkoutAnalyticsRef.current = checkoutAnalytics;
119
120
  copyRef.current = copy;
121
+ onCloseRef.current = onClose;
120
122
  onErrorRef.current = onError;
121
123
  onStateChangeRef.current = onStateChange;
122
124
  onSuccessRef.current = onSuccess;
123
- }, [checkoutAnalytics, copy, onError, onStateChange, onSuccess]);
125
+ }, [checkoutAnalytics, copy, onClose, onError, onStateChange, onSuccess]);
124
126
  useEffect(() => {
125
127
  setEmailInput((customerEmail === null || customerEmail === void 0 ? void 0 : customerEmail.trim()) || '');
126
128
  setCommittedEmail(normalizedCustomerEmail);
@@ -221,7 +223,7 @@ export function SolidgateCheckoutDialog({ open, request, customerEmail, checkout
221
223
  : null;
222
224
  const handleKeyDown = (event) => {
223
225
  if (event.key === 'Escape') {
224
- onClose();
226
+ onCloseRef.current();
225
227
  }
226
228
  };
227
229
  window.addEventListener('keydown', handleKeyDown);
@@ -230,7 +232,7 @@ export function SolidgateCheckoutDialog({ open, request, customerEmail, checkout
230
232
  window.removeEventListener('keydown', handleKeyDown);
231
233
  previouslyFocused === null || previouslyFocused === void 0 ? void 0 : previouslyFocused.focus();
232
234
  };
233
- }, [onClose, open]);
235
+ }, [open]);
234
236
  useEffect(() => () => {
235
237
  var _a, _b;
236
238
  (_a = prepareAbortRef.current) === null || _a === void 0 ? void 0 : _a.abort();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funnelsgrove/payments",
3
- "version": "0.7.11",
3
+ "version": "0.7.12",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/The-Solid-Grove/funnelsgrove.git",