Skip to content

Commit

Permalink
On media page, "Suggestions" tab should be the default when there are…
Browse files Browse the repository at this point in the history
… requests and suggestions

Currently, the default tab on the media page is "Requests". This PR changes it to "Suggestions", when there are both suggestions and requests associated with that item.

Reference: CV2-765.
  • Loading branch information
caiosba authored Oct 24, 2023
1 parent 4d6b016 commit 735f35f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/components/media/MediaComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ class MediaComponent extends Component {
let initialTab = 'metadata';
if (showRequests && this.props.view !== 'similarMedia') {
initialTab = 'requests';
if (this.props.projectMedia.suggested_similar_items_count > 0) {
initialTab = 'suggestedMedia';
}
} else if (this.props.view === 'similarMedia') {
initialTab = 'suggestedMedia';
}
Expand Down Expand Up @@ -268,6 +271,7 @@ export default createFragmentContainer(withPusher(MediaComponent), graphql`
creator_name
user_id
channel
suggested_similar_items_count
suggested_similar_relationships(first: 10000) {
edges {
node {
Expand Down

0 comments on commit 735f35f

Please sign in to comment.