File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -368,21 +368,23 @@ class Datatable
368368 }
369369
370370 async function loadFilters(api) {
371- let {filters, order} = JSON.parse(localStorage.getItem('filters_:tagId')) ?? {filters: [], order: []};
371+ let data = JSON.parse(localStorage.getItem('filters_:tagId')) ?? null;
372+
373+ if (data == null) { return; }
372374
373375 $('#:tagId .filters input, #:tagId .filters select').each(function (index, item) {
374- $(item).val(filters[index] ?? null);
375- api.columns(index).search(filters[index] ?? '')
376+ $(item).val(data. filters[index] ?? null);
377+ api.columns(index).search(data. filters[index] ?? '')
376378 });
377379
378- api.order(order);
380+ api.order(data. order);
379381
380382 api.draw();
381383 }
382384
383385 async function resetFilters(api) {
384386 await localStorage.removeItem('filters_:tagId');
385- await loadFilters(api)
387+ location.reload();
386388 }
387389
388390 function validateDate(text) {
You can’t perform that action at this time.
0 commit comments