Skip to content

Commit 41f2ece

Browse files
committed
Show icons on details view when they exist
1 parent aa30cf7 commit 41f2ece

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

components/system/Files/FileEntry/index.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import useDoubleClick from "hooks/useDoubleClick";
4141
import Button from "styles/common/Button";
4242
import Icon from "styles/common/Icon";
4343
import {
44+
EXTENSIONS_WITH_ICON,
4445
ICON_CACHE,
4546
ICON_CACHE_EXTENSION,
4647
ICON_PATH,
@@ -349,7 +350,7 @@ const FileEntry: FC<FileEntryProps> = ({
349350
!isLoadingFileManager &&
350351
isVisible &&
351352
!isIconCached.current &&
352-
!detailsView
353+
(!detailsView || EXTENSIONS_WITH_ICON.has(urlExt))
353354
) {
354355
const updateIcon = async (): Promise<void> => {
355356
if (icon.startsWith("blob:") || icon.startsWith("data:")) {
@@ -506,9 +507,7 @@ const FileEntry: FC<FileEntryProps> = ({
506507
updateIcon();
507508
}
508509

509-
if (!isVisible && getIconAbortController.current) {
510-
getIconAbortController.current.abort();
511-
}
510+
if (!isVisible) getIconAbortController.current?.abort();
512511
}, [
513512
detailsView,
514513
exists,

utils/constants.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,13 +274,14 @@ export const VIDEO_FILE_EXTENSIONS = new Set([
274274

275275
export const DYNAMIC_PREFIX = ["nostr:"];
276276

277+
export const EXTENSIONS_WITH_ICON = new Set([".ani", ".cur", ".exe", ".ico"]);
278+
277279
export const DYNAMIC_EXTENSION = new Set([
278280
...AUDIO_FILE_EXTENSIONS,
279281
...AUDIO_PLAYLIST_EXTENSIONS,
280282
...IMAGE_FILE_EXTENSIONS,
281283
...TIFF_IMAGE_FORMATS,
282284
...VIDEO_FILE_EXTENSIONS,
283-
".ani",
284285
".exe",
285286
".mp3",
286287
".sav",

0 commit comments

Comments
 (0)