1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Fix default icon handling and add tests

This commit is contained in:
Bill Thornton 2024-09-18 14:37:25 -04:00
parent cd14a6bcff
commit 2abc648dcf
3 changed files with 119 additions and 25 deletions

View file

@ -108,7 +108,7 @@ export function getLibraryIcon(library: CollectionType | string | null | undefin
}
}
export function getItemTypeIcon(itemType: BaseItemKind | string, defaultIcon?: string) {
export function getItemTypeIcon(itemType: BaseItemKind | string | undefined, defaultIcon?: string) {
switch (itemType) {
case BaseItemKind.MusicAlbum:
return 'album';
@ -136,8 +136,10 @@ export function getItemTypeIcon(itemType: BaseItemKind | string, defaultIcon?: s
return 'photo';
case BaseItemKind.PhotoAlbum:
return 'photo_album';
case undefined:
return;
default:
return defaultIcon || 'folder';
return defaultIcon;
}
}