Skip to content

Commit

Permalink
fix(vouchers): catch no-filter corner case
Browse files Browse the repository at this point in the history
This commit catches the default corner case where no filters have been initialized in the browser and appcache.  It fixes this by ensuring that there is always some filters cached.

Closes #1466.
  • Loading branch information
lomamech authored and jniles committed Apr 4, 2017
1 parent 0c7afe9 commit 6aad64f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/src/partials/vouchers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ function VoucherController(Vouchers, Notify, Filtering, uiGridGroupingConstants,
uiGridConstants, bhConstants, Receipts, Sorting, $state, AppCache,
Filters) {
var vm = this;
var cache = new AppCache('VoucherRegistry');

var filter = new Filters();
var filtering;
var FILTER_BAR_HEIGHT;
var cache = new AppCache('VoucherRegistry');

var INCOME = bhConstants.transactionType.INCOME;
var EXPENSE = bhConstants.transactionType.EXPENSE;
Expand Down Expand Up @@ -249,6 +250,7 @@ function VoucherController(Vouchers, Notify, Filtering, uiGridGroupingConstants,
if ($state.params.filters) {
cacheFilters($state.params.filters);
}
cacheFilters({});

vm.filters = cache.filters;
vm.filtersFmt = Vouchers.formatFilterParameters(vm.filters || {});
Expand Down

0 comments on commit 6aad64f

Please sign in to comment.