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:
@@ -46,7 +46,10 @@ class WikiMarkdownViewer extends React.Component {
|
|||||||
this.listRelatedFiles();
|
this.listRelatedFiles();
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps() {
|
componentWillReceiveProps(nextProps) {
|
||||||
|
if (this.props.markdownContent === nextProps.markdownContent) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Unbound event when updating
|
// Unbound event when updating
|
||||||
this.links.forEach(link => {
|
this.links.forEach(link => {
|
||||||
link.removeEventListener('click', this.onLinkClick);
|
link.removeEventListener('click', this.onLinkClick);
|
||||||
@@ -63,7 +66,7 @@ class WikiMarkdownViewer extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
// Rebinding events when the component is destroyed
|
// Unbound events when the component is destroyed
|
||||||
this.links.forEach(link => {
|
this.links.forEach(link => {
|
||||||
link.removeEventListener('click', this.onLinkClick);
|
link.removeEventListener('click', this.onLinkClick);
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user