mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 19:21:10 +00:00
Fixes the home page crashing when a library has no cover image
This commit is contained in:
1 parent
361dd66f76
commit
b008a70a0d
1 file changed
+6
-1
@@ -43,8 +43,13 @@
|
|||||||
const libraryDiv = document.createElement('div');
|
const libraryDiv = document.createElement('div');
|
||||||
libraryDiv.className = 'media-panel';
|
libraryDiv.className = 'media-panel';
|
||||||
|
|
||||||
|
// the cover image is optional, so it is only rendered when the library has one
|
||||||
|
const coverImageHtml = library.coverImage
|
||||||
|
? `<img src="${globalConfiguration.serverBasePath}/media/libraries/${library.id}/${library.coverImage.substring(library.coverImage.lastIndexOf('cover.'))}" />`
|
||||||
|
: '';
|
||||||
|
|
||||||
libraryDiv.innerHTML = `
|
libraryDiv.innerHTML = `
|
||||||
<img src="${globalConfiguration.serverBasePath}/media/libraries/${library.id}/${library.coverImage.substring(library.coverImage.lastIndexOf('cover.'))}" />
|
${coverImageHtml}
|
||||||
<span class="text-light-two"><strong>${library.title}</strong></span>
|
<span class="text-light-two"><strong>${library.title}</strong></span>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user