[filterBar] don't swallow errors
This commit is contained in:
parent
9f8a5a92bc
commit
9cb83548ae
|
@ -1,7 +1,8 @@
|
|||
define(function (require) {
|
||||
return function watchFiltersProvider(Promise) {
|
||||
return function watchFiltersProvider(Promise, Notifier) {
|
||||
var _ = require('lodash');
|
||||
var onlyDisabled = require('components/filter_bar/lib/onlyDisabled');
|
||||
var notify = new Notifier({ location: 'Fitler Bar' });
|
||||
|
||||
return function ($scope, handlers) {
|
||||
if (!handlers || !handlers.update || !handlers.fetch) {
|
||||
|
@ -14,10 +15,10 @@ define(function (require) {
|
|||
return Promise.resolve()
|
||||
.then(handlers.update)
|
||||
.then(function () {
|
||||
if (!onlyDisabled(newFilters, oldFilters)) {
|
||||
return handlers.fetch();
|
||||
}
|
||||
});
|
||||
if (onlyDisabled(newFilters, oldFilters)) return;
|
||||
return handlers.fetch();
|
||||
})
|
||||
.catch(notify.fatal);
|
||||
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue