diff --git a/plugin-api/beta/client/hocs/withTags.js b/plugin-api/beta/client/hocs/withTags.js index 7dff93f65..6d0ed920c 100644 --- a/plugin-api/beta/client/hocs/withTags.js +++ b/plugin-api/beta/client/hocs/withTags.js @@ -27,7 +27,10 @@ export default (tag) => (WrappedComponent) => { } } `; - + + const isTagged = (tags) => + !!tags.filter((t) => t.tag.name === Tag.toUpperCase()).length; + const withAddTag = withMutation( gql` mutation AddTag($id: ID!, $asset_id: ID!, $name: String!) { @@ -112,7 +115,7 @@ export default (tag) => (WrappedComponent) => { class WithTags extends React.Component { - postTag = () => { + postTag() { const {comment, asset} = this.props; this.props.addTag({ @@ -122,7 +125,7 @@ export default (tag) => (WrappedComponent) => { }); } - deleteTag = () => { + deleteTag() { const {comment, asset} = this.props; this.props.removeTag({ @@ -135,8 +138,6 @@ export default (tag) => (WrappedComponent) => { render() { const {comment} = this.props; - const isTagged = (tags) => !!tags.filter((t) => t.tag.name === Tag.toUpperCase()).length; - const alreadyTagged = isTagged(comment.tags); return