Skip to content

Commit

Permalink
PISHPS-293: added fallback for Shopware.Utils.dom.copyToClipboard if …
Browse files Browse the repository at this point in the history
…unavailable
  • Loading branch information
m-muxfeld-diw committed Jun 26, 2024
1 parent 98c5314 commit 90c7cf8
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,20 @@ Component.override('sw-order-detail-general', {
return orderAttributes.getCreditCardAttributes();
},



/**
*
*/
copyPaymentUrlToClipboard() {
let fallback = async function(e) {
await navigator.clipboard.writeText(e)
};

// eslint-disable-next-line no-undef
let clipboard = typeof Shopware.Utils.dom.copyToClipboard === 'function' ? Shopware.Utils.dom.copyToClipboard : fallback;
// eslint-disable-next-line no-undef
Shopware.Utils.dom.copyToClipboard(this.molliePaymentUrl);
clipboard(this.molliePaymentUrl);
this.molliePaymentUrlCopied = true;
},

Expand Down

0 comments on commit 90c7cf8

Please sign in to comment.