Additional filtering of internal tags

This commit is contained in:
Dan Peterson 2021-12-30 15:57:02 -06:00 committed by Thomas Zarebczan
parent 2eb6af10ba
commit 16e99fc063
2 changed files with 7 additions and 1 deletions

View file

@ -13,6 +13,7 @@ import ChannelThumbnail from 'component/channelThumbnail';
import * as ICONS from 'constants/icons';
import Icon from 'component/common/icon';
import { NO_FILE } from 'redux/actions/publish';
import { INTERNAL_TAGS } from 'constants/tags';
type Props = {
filePath: string | WebFile,
@ -200,9 +201,11 @@ const ModalPublishPreview = (props: Props) => {
<p>{licenseType}</p>
);
const visibleTags = tags.filter((tag) => !INTERNAL_TAGS.includes(tag.name));
const tagsValue =
// Do nothing for onClick(). Setting to 'null' results in "View Tag" action -- we don't want to leave the modal.
tags.map((tag) => <Tag key={tag.name} title={tag.name} name={tag.name} type={'flow'} onClick={() => {}} />);
visibleTags.map((tag) => <Tag key={tag.name} title={tag.name} name={tag.name} type={'flow'} onClick={() => {}} />);
const depositValue = bid ? <LbcSymbol postfix={`${bid}`} size={14} /> : <p>---</p>;

View file

@ -333,6 +333,9 @@ export const makeSelectMetadataForUri = (uri: string) =>
export const makeSelectMetadataItemForUri = (uri: string, key: string) =>
createSelector(makeSelectMetadataForUri(uri), (metadata: ChannelMetadata | StreamMetadata) => {
if (key === 'tags') {
return metadata.tags ? metadata.tags.filter((tag) => !INTERNAL_TAGS.includes(tag)) : [];
}
return metadata ? metadata[key] : undefined;
});