perf: get recent transaction only when component is visible

This commit is contained in:
Saqib Ansari
2020-11-24 16:09:11 +05:30
parent 7f1d7894c2
commit ac164c66ed

View File

@@ -62,7 +62,7 @@ erpnext.PointOfSale.PastOrderList = class {
options: `Draft\nPaid\nConsolidated\nReturn`, options: `Draft\nPaid\nConsolidated\nReturn`,
placeholder: __('Filter by invoice status'), placeholder: __('Filter by invoice status'),
onchange: function() { onchange: function() {
me.refresh_list(me.search_field.get_value(), this.value); if (me.$component.is(':visible')) me.refresh_list();
} }
}, },
parent: this.$component.find('.status-field'), parent: this.$component.find('.status-field'),