1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-13 13:50:07 +00:00

fix wiki-markdown-viewer (#3825)

This commit is contained in:
Michael An
2019-07-09 10:14:59 +08:00
committed by Daniel Pan
parent 6cb4d38788
commit 03d17520c8

View File

@@ -46,7 +46,10 @@ class WikiMarkdownViewer extends React.Component {
this.listRelatedFiles();
}
componentWillReceiveProps() {
componentWillReceiveProps(nextProps) {
if (this.props.markdownContent === nextProps.markdownContent) {
return;
}
// Unbound event when updating
this.links.forEach(link => {
link.removeEventListener('click', this.onLinkClick);
@@ -63,7 +66,7 @@ class WikiMarkdownViewer extends React.Component {
}
componentWillUnmount() {
// Rebinding events when the component is destroyed
// Unbound events when the component is destroyed
this.links.forEach(link => {
link.removeEventListener('click', this.onLinkClick);
});