fix react embedly (#1089)

This commit is contained in:
Devin Howard 2017-03-09 11:23:24 -08:00 committed by Connor Turland
parent de4f51bb5c
commit 780e66632b
2 changed files with 8 additions and 3 deletions

View file

@ -9,7 +9,11 @@ class Attachments extends Component {
return (
<div className="attachments">
<EmbedlyLink link={link} authorizedToEdit={authorizedToEdit} updateTopic={updateTopic} />
<EmbedlyLink topicId={topic.id}
link={link}
authorizedToEdit={authorizedToEdit}
updateTopic={updateTopic}
/>
</div>
)
}

View file

@ -34,7 +34,7 @@ class EmbedlyLink extends Component {
}
render = () => {
const { link, authorizedToEdit } = this.props
const { link, authorizedToEdit, topicId } = this.props
const { linkEdit } = this.state
const hasAttachment = !!link
@ -55,7 +55,7 @@ class EmbedlyLink extends Component {
{linkEdit && <div id="addLinkReset" onClick={this.resetLink}></div>}
</div>
</div>
{link && <Card link={link} />}
{link && <Card key={topicId} link={link} />}
{authorizedToEdit && (
<div id="linkremove"
style={{ display: hasAttachment ? 'block' : 'none' }}
@ -68,6 +68,7 @@ class EmbedlyLink extends Component {
}
EmbedlyLink.propTypes = {
topicId: PropTypes.number,
link: PropTypes.string,
authorizedToEdit: PropTypes.bool,
updateTopic: PropTypes.func