mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 06:30:15 +08:00
8b426431a4
We want to wrap the `Ember.run.debounce` function and internally call `Ember.run` instead when running tests. This commit changes discourseDebounce to work the same way as `Ember.run.debounce`. Now that `discourseDebounce` works exactly like `Ember.run.debounce`, let's replace it and only use `DiscourseDebounce` from now on. Move debounce to discourse-common to be able to reuse it in different bundles Keep old debounce file for backwards-compatibility
19 lines
620 B
JavaScript
19 lines
620 B
JavaScript
import AdminEmailLogsController from "admin/controllers/admin-email-logs";
|
|
import { INPUT_DELAY } from "discourse-common/config/environment";
|
|
import IncomingEmail from "admin/models/incoming-email";
|
|
import discourseDebounce from "discourse-common/lib/debounce";
|
|
import { observes } from "discourse-common/utils/decorators";
|
|
|
|
export default AdminEmailLogsController.extend({
|
|
@observes("filter.{status,from,to,subject,error}")
|
|
filterIncomingEmails() {
|
|
discourseDebounce(this, this.loadLogs, IncomingEmail, INPUT_DELAY);
|
|
},
|
|
|
|
actions: {
|
|
loadMore() {
|
|
this.loadLogs(IncomingEmail, true);
|
|
},
|
|
},
|
|
});
|