Skip to content

Commit

Permalink
add comment about orig matchid
Browse files Browse the repository at this point in the history
  • Loading branch information
Rathoz committed Oct 19, 2024
1 parent e74f114 commit 80c6555
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/match2/wikis/dota2/match_summary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,17 @@ end
---@param match MatchGroupUtilMatch
---@return MatchSummaryBody
function CustomMatchSummary.createBody(match)
-- Original Match Id must be used to match page links if it exists.
-- It can be different from the matchId when shortened brackets are used.
local matchId = match.extradata.originalmatchid or match.matchId

local showCountdown = match.timestamp ~= DateExt.defaultTimestamp
local showMatchPage = MatchPage.isEnabledFor(match)
local characterBansData = MatchSummary.buildCharacterBanData(match.games, MAX_NUM_BANS)

return MatchSummaryWidgets.Body{children = WidgetUtil.collect(
showCountdown and MatchSummaryWidgets.Row{children = DisplayHelper.MatchCountdownBlock(match)} or nil,
showMatchPage and MatchSummaryWidgets.MatchPageLink{matchId = match.extradata.originalmatchid or match.matchId} or nil,
showMatchPage and MatchSummaryWidgets.MatchPageLink{matchId = matchId} or nil,
unpack(Array.map(match.games, CustomMatchSummary._createGame)),
MatchSummaryWidgets.Mvp(match.extradata.mvp),
MatchSummaryWidgets.CharacterBanTable{bans = characterBansData, date = match.date},
Expand Down

0 comments on commit 80c6555

Please sign in to comment.