fix(frontend): do not show failed media status on request list for declined requests

fixes #664
pull/671/head
sct 4 years ago
parent 7db62ab824
commit 00944b1ec2

@ -180,9 +180,12 @@ const RequestItem: React.FC<RequestItemProps> = ({
</div> </div>
</Table.TD> </Table.TD>
<Table.TD> <Table.TD>
{requestData.media.status === MediaStatus.UNKNOWN ? ( {requestData.media.status === MediaStatus.UNKNOWN ||
requestData.status === MediaRequestStatus.DECLINED ? (
<Badge badgeType="danger"> <Badge badgeType="danger">
{intl.formatMessage(globalMessages.failed)} {requestData.status === MediaRequestStatus.DECLINED
? intl.formatMessage(globalMessages.declined)
: intl.formatMessage(globalMessages.failed)}
</Badge> </Badge>
) : ( ) : (
<StatusBadge status={requestData.media.status} /> <StatusBadge status={requestData.media.status} />
@ -216,6 +219,7 @@ const RequestItem: React.FC<RequestItemProps> = ({
</Table.TD> </Table.TD>
<Table.TD alignText="right"> <Table.TD alignText="right">
{requestData.media.status === MediaStatus.UNKNOWN && {requestData.media.status === MediaStatus.UNKNOWN &&
requestData.status !== MediaRequestStatus.DECLINED &&
hasPermission(Permission.MANAGE_REQUESTS) && ( hasPermission(Permission.MANAGE_REQUESTS) && (
<Button <Button
className="mr-2" className="mr-2"

Loading…
Cancel
Save