From c53ddb7723720e4c5d98f830b731be4376c00d03 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 9 Nov 2017 15:34:46 -0500 Subject: [PATCH] FIX: Sometimes viewing a user's action logs would reset to view all --- .../controllers/admin-logs-staff-action-logs.js.es6 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/admin/controllers/admin-logs-staff-action-logs.js.es6 b/app/assets/javascripts/admin/controllers/admin-logs-staff-action-logs.js.es6 index 4899c4b59ee..626fe955ce1 100644 --- a/app/assets/javascripts/admin/controllers/admin-logs-staff-action-logs.js.es6 +++ b/app/assets/javascripts/admin/controllers/admin-logs-staff-action-logs.js.es6 @@ -30,7 +30,7 @@ export default Ember.Controller.extend({ showInstructions: Ember.computed.gt('model.length', 0), - refresh: function() { + _refresh() { this.set('loading', true); var filters = this.get('filters'), @@ -65,14 +65,18 @@ export default Ember.Controller.extend({ }); }, + scheduleRefresh() { + Ember.run.scheduleOnce('afterRender', this, this._refresh); + }, + resetFilters: function() { this.set('filters', Ember.Object.create()); - this.refresh(); + this.scheduleRefresh(); }.on('init'), _changeFilters: function(props) { this.get('filters').setProperties(props); - this.refresh(); + this.scheduleRefresh(); }, actions: { @@ -91,7 +95,7 @@ export default Ember.Controller.extend({ this._changeFilters(changed); }, - clearAllFilters: function() { + clearAllFilters() { this.set("filterActionId", null); this.resetFilters(); },