FIX: Sometimes viewing a user's action logs would reset to view all

This commit is contained in:
Robin Ward 2017-11-09 15:34:46 -05:00
parent 16ff2a4715
commit c53ddb7723
1 changed files with 8 additions and 4 deletions

View File

@ -30,7 +30,7 @@ export default Ember.Controller.extend({
showInstructions: Ember.computed.gt('model.length', 0), showInstructions: Ember.computed.gt('model.length', 0),
refresh: function() { _refresh() {
this.set('loading', true); this.set('loading', true);
var filters = this.get('filters'), var filters = this.get('filters'),
@ -65,14 +65,18 @@ export default Ember.Controller.extend({
}); });
}, },
scheduleRefresh() {
Ember.run.scheduleOnce('afterRender', this, this._refresh);
},
resetFilters: function() { resetFilters: function() {
this.set('filters', Ember.Object.create()); this.set('filters', Ember.Object.create());
this.refresh(); this.scheduleRefresh();
}.on('init'), }.on('init'),
_changeFilters: function(props) { _changeFilters: function(props) {
this.get('filters').setProperties(props); this.get('filters').setProperties(props);
this.refresh(); this.scheduleRefresh();
}, },
actions: { actions: {
@ -91,7 +95,7 @@ export default Ember.Controller.extend({
this._changeFilters(changed); this._changeFilters(changed);
}, },
clearAllFilters: function() { clearAllFilters() {
this.set("filterActionId", null); this.set("filterActionId", null);
this.resetFilters(); this.resetFilters();
}, },