X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=resources%2Fjs%2Fcomponents%2Fresults%2FItem.js;h=2a1fc8c07f4cbb404be0f030b0315e274720dc33;hb=8078d2d7e3363679874caaa571a1c138438c95e2;hp=0d0d34e81a11553f7535be8a883d1fabb7df378d;hpb=878ceac3fc16d0c611c5002ae5d0605f1a07a8b4;p=alttp.git diff --git a/resources/js/components/results/Item.js b/resources/js/components/results/Item.js index 0d0d34e..2a1fc8c 100644 --- a/resources/js/components/results/Item.js +++ b/resources/js/components/results/Item.js @@ -9,11 +9,11 @@ import { findResult } from '../../helpers/Participant'; import { maySeeResults } from '../../helpers/permissions'; import { withUser } from '../../helpers/UserContext'; -const getIcon = (result, index) => { +const getIcon = (result, index, maySee) => { if (!result || !result.has_finished) { return ; } - if (result.forfeit) { + if (result.forfeit && maySee) { return ; } if (index === 0) { @@ -28,8 +28,8 @@ const getIcon = (result, index) => { return ; }; -const getTime = (user, tournament, round, result) => { - if (!result || !maySeeResults(user, tournament, round)) { +const getTime = (result, maySee) => { + if (!result || !maySee) { return null; } if (result.time) { @@ -49,13 +49,14 @@ const Item = ({ user, }) => { const result = findResult(participant, round); + const maySee = maySeeResults(user, tournament, round); return
- {getTime(user, tournament, round, result)} + {getTime(result, maySee)} - {getIcon(result, index)} + {getIcon(result, index, maySee)}
; };