From 6c37a9a3aff74bc59646fe20c1f372c3e8892940 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Fri, 18 Aug 2017 12:03:29 +0100 Subject: [PATCH] Simplify getting of content, prev content for widget event --- src/TextForEvent.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TextForEvent.js b/src/TextForEvent.js index 8d6ef41180..d75ef34c1c 100644 --- a/src/TextForEvent.js +++ b/src/TextForEvent.js @@ -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