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:
parent
cd14a6bcff
commit
2abc648dcf
3 changed files with 119 additions and 25 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue