Rework Tags for Music

This commit is contained in:
Qstick 2017-09-23 00:30:52 -04:00
parent d6efae537f
commit 8f45fe0afe
6 changed files with 27 additions and 20 deletions

View file

@ -49,7 +49,7 @@ class TagsModalContent extends Component {
render() {
const {
seriesTags,
artistTags,
tagList,
onModalClose,
onApplyTagsPress
@ -108,7 +108,7 @@ class TagsModalContent extends Component {
<div className={styles.result}>
{
seriesTags.map((t) => {
artistTags.map((t) => {
const tag = _.find(tagList, { id: t });
if (!tag) {
@ -140,7 +140,7 @@ class TagsModalContent extends Component {
return null;
}
if (seriesTags.indexOf(t) > -1) {
if (artistTags.indexOf(t) > -1) {
return null;
}
@ -179,7 +179,7 @@ class TagsModalContent extends Component {
}
TagsModalContent.propTypes = {
seriesTags: PropTypes.arrayOf(PropTypes.number).isRequired,
artistTags: PropTypes.arrayOf(PropTypes.number).isRequired,
tagList: PropTypes.arrayOf(PropTypes.object).isRequired,
onModalClose: PropTypes.func.isRequired,
onApplyTagsPress: PropTypes.func.isRequired

View file

@ -15,10 +15,10 @@ function createMapStateToProps() {
return s.id === id;
});
const seriesTags = _.uniq(_.concat(..._.map(series, 'tags')));
const artistTags = _.uniq(_.concat(..._.map(series, 'tags')));
return {
seriesTags,
artistTags,
tagList
};
}