File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,11 +11,13 @@ export const parsedTags = writable<ParsedTag[]>([]);
1111
1212export function setFilters ( localTags : TagValue [ ] , filterCols : FilterData [ ] , $columns : Column [ ] ) {
1313 if ( ! localTags ?. length ) {
14+ parsedTags . set ( [ ] ) ;
1415 filterCols . forEach ( ( filter ) => {
1516 resetOptions ( filter ) ;
1617 cleanOldTags ( filter ?. title ) ;
1718 } ) ;
1819 } else {
20+ parsedTags . set ( [ ] ) ;
1921 filterCols . forEach ( ( filter ) => {
2022 const id = filter ?. id ?. toLowerCase ( ) ;
2123 if ( id ?. includes ( 'duration' ) ) {
Original file line number Diff line number Diff line change 1414 import DisplaySettingsModal from ' ./displaySettingsModal.svelte' ;
1515 import { buildFilterCol } from ' $lib/components/filters/quickFilters' ;
1616 import { afterNavigate } from ' $app/navigation' ;
17- import { setFilters } from ' $lib/components/filters/setFilters' ;
17+ import { parsedTags , setFilters } from ' $lib/components/filters/setFilters' ;
1818
1919 let {
2020 columns,
4848 let showDisplaySettingsModal = $state (false );
4949 let showFilters = $state (false );
5050
51- let filterCols = $derived (
51+ const filterCols = $derived (
5252 $columns .map ((col ) => (col .filter !== false ? buildFilterCol (col ) : null )).filter (Boolean )
5353 );
54+ const filtersBadge = $derived (
55+ filtersStyle === ' dropdown' && $parsedTags ?.length ? ` ${$parsedTags .length } ` : undefined
56+ );
5457
5558 afterNavigate ((p ) => {
5659 if (! hasFilters ) return ;
192195{/ snippet }
193196
194197{#snippet filtersButton (icon = false )}
195- <Button ariaLabel ="Filters" on:click ={() => (showFilters = ! showFilters )} text {icon }>
198+ <Button
199+ ariaLabel =" Filters"
200+ on:click ={() => (showFilters = ! showFilters )}
201+ text
202+ {icon }
203+ badge ={filtersBadge }>
196204 <Icon icon ={IconFilterLine } />
197205 </Button >
198206{/ snippet }
You can’t perform that action at this time.
0 commit comments