diff --git a/src/clipboard-action.js b/src/clipboard-action.js index 73903e5..074aad8 100644 --- a/src/clipboard-action.js +++ b/src/clipboard-action.js @@ -119,21 +119,12 @@ class ClipboardAction { * @param {Boolean} succeeded */ handleResult(succeeded) { - if (succeeded) { - this.emitter.emit('success', { - action: this.action, - text: this.selectedText, - trigger: this.trigger, - clearSelection: this.clearSelection.bind(this) - }); - } - else { - this.emitter.emit('error', { - action: this.action, - trigger: this.trigger, - clearSelection: this.clearSelection.bind(this) - }); - } + this.emitter.emit(succeeded ? 'success' : 'error', { + action: this.action, + text: this.selectedText, + trigger: this.trigger, + clearSelection: this.clearSelection.bind(this) + }); } /**