Simplify getting of content, prev content for widget event

pull/21833/head
Luke Barnard 2017-08-18 12:03:29 +01:00
parent 9382689675
commit 6c37a9a3af
1 changed files with 2 additions and 2 deletions

View File

@ -250,8 +250,8 @@ function textForPowerEvent(event) {
function textForWidgetEvent(event) {
const senderName = event.sender ? event.sender.name : event.getSender();
const previousContent = event.getPrevContent() ? event.getPrevContent() : {};
const {name, type, url} = event.getContent() ? event.getContent() : {};
const previousContent = event.getPrevContent() || {};
const {name, type, url} = event.getContent() || {};
let widgetName = widgetName || name || type || previousContent.type || '';
// Apply sentence case