|
|
@@ -50,16 +50,17 @@ class LinkEditModal extends React.PureComponent {
|
|
|
this.toggleIsUsePamanentLink = this.toggleIsUsePamanentLink.bind(this);
|
|
|
this.save = this.save.bind(this);
|
|
|
this.generateLink = this.generateLink.bind(this);
|
|
|
- this.getPreview = debounce(1000, this.getPreview.bind(this));
|
|
|
this.renderPreview = this.renderPreview.bind(this);
|
|
|
this.getRootPath = this.getRootPath.bind(this);
|
|
|
+
|
|
|
+ this.getPreviewDebounced = debounce(200, this.getPreview.bind(this));
|
|
|
}
|
|
|
|
|
|
componentDidUpdate(prevState) {
|
|
|
const { linkInputValue: prevLinkInputValue } = prevState;
|
|
|
const { linkInputValue } = this.state;
|
|
|
if (linkInputValue !== prevLinkInputValue) {
|
|
|
- this.getPreview(linkInputValue);
|
|
|
+ this.getPreviewDebounced(linkInputValue);
|
|
|
}
|
|
|
}
|
|
|
|