Răsfoiți Sursa

cahnged to getPreviewDebounced

ryuichi-e 5 ani în urmă
părinte
comite
52e2c837ae
1 a modificat fișierele cu 3 adăugiri și 2 ștergeri
  1. 3 2
      src/client/js/components/PageEditor/LinkEditModal.jsx

+ 3 - 2
src/client/js/components/PageEditor/LinkEditModal.jsx

@@ -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);
     }
   }