From 13592057b98b61c1268aa009203eacc1b72859a0 Mon Sep 17 00:00:00 2001 From: Rikard Blixt Date: Sat, 19 Oct 2024 10:46:11 +0200 Subject: [PATCH] simplify --- components/match2/wikis/dota2/match_summary.lua | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/components/match2/wikis/dota2/match_summary.lua b/components/match2/wikis/dota2/match_summary.lua index c3af3a9fcc4..18b0520bc3a 100644 --- a/components/match2/wikis/dota2/match_summary.lua +++ b/components/match2/wikis/dota2/match_summary.lua @@ -92,14 +92,11 @@ function CustomMatchSummary._createGame(game, gameIndex) end end - -- Add Comment - local comment = {} - if Logic.isNotEmpty(game.comment) then - comment = { - MatchSummary.Break():create(), - HtmlWidgets.Div{css = {margin = 'auto'}, children = game.comment}, - } - end + -- Map Comment + local comment = Logic.isNotEmpty(game.comment) and { + MatchSummary.Break():create(), + HtmlWidgets.Div{css = {margin = 'auto'}, children = game.comment}, + } or {} return MatchSummaryWidgets.Row{ classes = {'brkts-popup-body-game'},