mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
21 lines
662 B
JavaScript
21 lines
662 B
JavaScript
import IncomingEmail from 'admin/models/incoming-email';
|
|
|
|
export default Ember.Controller.extend({
|
|
loading: false,
|
|
|
|
actions: {
|
|
|
|
loadMore() {
|
|
if (this.get("loading") || this.get("model.allLoaded")) { return; }
|
|
this.set('loading', true);
|
|
|
|
IncomingEmail.findAll(this.get("filter"), this.get("model.length"))
|
|
.then(incoming => {
|
|
if (incoming.length < 50) { this.get("model").set("allLoaded", true); }
|
|
this.get("model").addObjects(incoming);
|
|
}).finally(() => {
|
|
this.set('loading', false);
|
|
});
|
|
}
|
|
}
|
|
});
|