mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
🐛 Check if cancel is possible before calling it
This commit is contained in:
parent
119fdec839
commit
85ad2f8edb
1 changed files with 3 additions and 1 deletions
|
@ -69,7 +69,9 @@ export const usePhoneSyncHandler = ( paymentComponent ) => {
|
||||||
// Cleanup on unmount, canceling any pending debounced calls.
|
// Cleanup on unmount, canceling any pending debounced calls.
|
||||||
useEffect( () => {
|
useEffect( () => {
|
||||||
return () => {
|
return () => {
|
||||||
|
if ( debouncedUpdatePhone?.cancel ) {
|
||||||
debouncedUpdatePhone.cancel();
|
debouncedUpdatePhone.cancel();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}, [ debouncedUpdatePhone ] );
|
}, [ debouncedUpdatePhone ] );
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue