Skip to content

Commit

Permalink
s/thumbnailUrl/thumbnail.url/
Browse files Browse the repository at this point in the history
  • Loading branch information
binzume committed Dec 25, 2023
1 parent 4041bf3 commit 1ecd48d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions storage/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -796,14 +796,14 @@ class FileListView {

_createItemEl(f, prefix) {
let iconEl = mkEl('img', [], { 'className': 'thumbnail' });
if (f.thumbnail && f.thumbnail.fetch) {
if (f.thumbnail && f.thumbnail.fetch && !f.thumbnail.url) {
this.imageLoadQueue.add(iconEl, async el => {
let url = URL.createObjectURL(await (await f.thumbnail.fetch()).blob());
el.addEventListener('load', ev => URL.revokeObjectURL(url), { once: true });
el.src = url;
});
} else {
let turl = f.thumbnailUrl || (f.type == 'folder' || f.type == 'list' ? 'images/icon_folder.svg' : 'images/icon_file.svg');
let turl = f.thumbnail && f.thumbnail.url || (f.type == 'folder' || f.type == 'list' ? 'images/icon_folder.svg' : 'images/icon_file.svg');
this.imageLoadQueue.add(iconEl, el => el.src = turl);
}

Expand Down

0 comments on commit 1ecd48d

Please sign in to comment.