Skip to content

Commit

Permalink
check if clipboard is available before using it
Browse files Browse the repository at this point in the history
(not available in unsafe environments)
  • Loading branch information
undefined committed Apr 9, 2023
1 parent 132d1c0 commit 3956033
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/class/cv/ui/manager/core/IconAtom.js
Expand Up @@ -61,8 +61,10 @@ qx.Class.define('cv.ui.manager.core.IconAtom', {
_iconChildControlName: null,

_onTap() {
navigator.clipboard.writeText(this.getLabel());
cv.ui.manager.snackbar.Controller.info(qx.locale.Manager.tr('Icon name has been copied to clipboard'));
if (typeof navigator.clipboard === 'object') {
navigator.clipboard.writeText(this.getLabel());
cv.ui.manager.snackbar.Controller.info(qx.locale.Manager.tr('Icon name has been copied to clipboard'));
}
},

// property apply
Expand Down

0 comments on commit 3956033

Please sign in to comment.