@@ -194,7 +194,7 @@ export function AuthFilesPage() {
194194 const persisted = readAuthFilesUiState ( ) ;
195195 if ( persisted ) {
196196 if ( typeof persisted . filter === 'string' && persisted . filter . trim ( ) ) {
197- setFilter ( persisted . filter ) ;
197+ setFilter ( normalizeProviderKey ( persisted . filter ) ) ;
198198 }
199199 if ( typeof persisted . problemOnly === 'boolean' ) {
200200 setProblemOnly ( persisted . problemOnly ) ;
@@ -349,9 +349,8 @@ export function AuthFilesPage() {
349349 const existingTypes = useMemo ( ( ) => {
350350 const types = new Set < string > ( [ 'all' ] ) ;
351351 files . forEach ( ( file ) => {
352- if ( file . type ) {
353- types . add ( file . type ) ;
354- }
352+ const type = normalizeProviderKey ( String ( file . type ?? file . provider ?? '' ) ) ;
353+ if ( type ) types . add ( type ) ;
355354 } ) ;
356355 return Array . from ( types ) ;
357356 } , [ files ] ) ;
@@ -378,8 +377,9 @@ export function AuthFilesPage() {
378377 const typeCounts = useMemo ( ( ) => {
379378 const counts : Record < string , number > = { all : filesMatchingStatusFilters . length } ;
380379 filesMatchingStatusFilters . forEach ( ( file ) => {
381- if ( ! file . type ) return ;
382- counts [ file . type ] = ( counts [ file . type ] || 0 ) + 1 ;
380+ const type = normalizeProviderKey ( String ( file . type ?? file . provider ?? '' ) ) ;
381+ if ( ! type ) return ;
382+ counts [ type ] = ( counts [ type ] || 0 ) + 1 ;
383383 } ) ;
384384 return counts ;
385385 } , [ filesMatchingStatusFilters ] ) ;
@@ -391,7 +391,8 @@ export function AuthFilesPage() {
391391 const normalizedTerm = normalizedSearch . toLowerCase ( ) ;
392392
393393 return filesMatchingStatusFilters . filter ( ( item ) => {
394- const matchType = filter === 'all' || item . type === filter ;
394+ const type = normalizeProviderKey ( String ( item . type ?? item . provider ?? '' ) ) ;
395+ const matchType = normalizedFilter === 'all' || type === normalizedFilter ;
395396 const matchSearch =
396397 ! normalizedSearch ||
397398 [ item . name , item . type , item . provider ] . some ( ( value ) => {
@@ -402,7 +403,7 @@ export function AuthFilesPage() {
402403 } ) ;
403404 return matchType && matchSearch ;
404405 } ) ;
405- } , [ filesMatchingStatusFilters , filter , normalizedSearch , wildcardSearch ] ) ;
406+ } , [ filesMatchingStatusFilters , normalizedFilter , normalizedSearch , wildcardSearch ] ) ;
406407
407408 const sorted = useMemo ( ( ) => {
408409 const copy = [ ...filtered ] ;
@@ -586,7 +587,7 @@ export function AuthFilesPage() {
586587 < div className = { styles . filterRail } >
587588 < div className = { styles . filterTags } >
588589 { existingTypes . map ( ( type ) => {
589- const isActive = filter === type ;
590+ const isActive = normalizedFilter === type ;
590591 const iconSrc = getAuthFileIcon ( type , resolvedTheme ) ;
591592 const color =
592593 type === 'all'
@@ -646,13 +647,15 @@ export function AuthFilesPage() {
646647 return t ( 'auth_files.delete_filtered_result_button' ) ;
647648 }
648649 if ( problemOnly ) {
649- return filter === 'all'
650+ return normalizedFilter === 'all'
650651 ? t ( 'auth_files.delete_problem_button' )
651- : t ( 'auth_files.delete_problem_button_with_type' , { type : getTypeLabel ( t , filter ) } ) ;
652+ : t ( 'auth_files.delete_problem_button_with_type' , {
653+ type : getTypeLabel ( t , normalizedFilter ) ,
654+ } ) ;
652655 }
653- return filter === 'all'
656+ return normalizedFilter === 'all'
654657 ? t ( 'auth_files.delete_all_button' )
655- : `${ t ( 'common.delete' ) } ${ getTypeLabel ( t , filter ) } ` ;
658+ : `${ t ( 'common.delete' ) } ${ getTypeLabel ( t , normalizedFilter ) } ` ;
656659 } ) ( ) ;
657660
658661 return (
0 commit comments