diff --git a/packages/suite/src/actions/suite/copyAddressActions.ts b/packages/suite/src/actions/suite/copyAddressActions.ts index c35a2dcb68d..9b22c7f88a3 100644 --- a/packages/suite/src/actions/suite/copyAddressActions.ts +++ b/packages/suite/src/actions/suite/copyAddressActions.ts @@ -26,3 +26,15 @@ export const copyAddressToClipboard = (address: string) => (dispatch: Dispatch) dispatch(notificationsActions.addToast({ type: 'copy-to-clipboard' })); } }; + +export const onCopyAddressWithModal = ( + address: string, + addressType: AddressType, + shouldShowCopyAddressModal: boolean, +) => { + if (shouldShowCopyAddressModal) { + showCopyAddressModal(address, addressType); + } else { + copyAddressToClipboard(address); + } +};