@capillarytech/creatives-library 7.17.114 → 7.17.116
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -239,6 +239,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
239
239
|
this.onAccountSelect = this.onAccountSelect.bind(this);
|
|
240
240
|
this.prepareMobilePushPreviewData = this.prepareMobilePushPreviewData.bind(this);
|
|
241
241
|
this.menuOnClickEvent = this.menuOnClickEvent.bind(this);
|
|
242
|
+
this.delayTimer = 0;
|
|
242
243
|
}
|
|
243
244
|
|
|
244
245
|
componentWillMount() {
|
|
@@ -1766,6 +1767,11 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1766
1767
|
}
|
|
1767
1768
|
}
|
|
1768
1769
|
|
|
1770
|
+
delay(callback, ms) {
|
|
1771
|
+
clearTimeout(this.delayTimer);
|
|
1772
|
+
this.delayTimer = setTimeout(callback, ms);
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1769
1775
|
searchTemplate(data, channel) {
|
|
1770
1776
|
if (channel.toLowerCase() === ZALO_LOWERCASE) {
|
|
1771
1777
|
if (data) {
|
|
@@ -1795,7 +1801,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1795
1801
|
if (this.state.channel.toLowerCase() === MOBILE_PUSH_LOWERCASE) {
|
|
1796
1802
|
params.accountId = this.props.Templates.selectedWeChatAccount.id;
|
|
1797
1803
|
}
|
|
1798
|
-
this.
|
|
1804
|
+
this.delay(() => {
|
|
1805
|
+
this.getAllTemplates({params, resetPage: true});
|
|
1806
|
+
}, 500);
|
|
1799
1807
|
});
|
|
1800
1808
|
}
|
|
1801
1809
|
}
|