Skip to content

Commit

Permalink
feat(component): allow users to request new seasons
Browse files Browse the repository at this point in the history
When a new season of a show already available launches, the users can't ask for the new season as
the request more button doesn't appear, this commit aims to fix this

#962
  • Loading branch information
ToMattBan committed Sep 13, 2024
1 parent 4e0a923 commit 43d204c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/components/RequestButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,23 @@ const RequestButton = ({
},
svg: <ArrowDownTrayIcon />,
});
} else if (
mediaType === 'tv' &&
hasPermission([Permission.REQUEST, Permission.REQUEST_TV], {
type: 'or',
}) &&
media &&
media.status === MediaStatus.PARTIALLY_AVAILABLE
) {
buttons.push({
id: 'request-more',
text: intl.formatMessage(messages.requestmore),
action: () => {
setEditRequest(false);
setShowRequestModal(true);
},
svg: <ArrowDownTrayIcon />,
});
} else if (
mediaType === 'tv' &&
(!activeRequest || activeRequest.requestedBy.id !== user?.id) &&
Expand Down

0 comments on commit 43d204c

Please sign in to comment.