Skip to content

Commit

Permalink
feat(suite): onCopyAddressWithModal function
Browse files Browse the repository at this point in the history
  • Loading branch information
enjojoy committed Dec 12, 2024
1 parent 8b50ad8 commit 8fcf8fc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/suite/src/actions/suite/copyAddressActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};

0 comments on commit 8fcf8fc

Please sign in to comment.