mirror of
https://github.com/DustinBrett/daedalOS.git
synced 2025-12-06 12:20:20 +01:00
Show icons on details view when they exist
Some checks failed
Tests / tests (push) Has been cancelled
Some checks failed
Tests / tests (push) Has been cancelled
This commit is contained in:
parent
aa30cf7e4b
commit
41f2ece1eb
|
|
@ -41,6 +41,7 @@ import useDoubleClick from "hooks/useDoubleClick";
|
||||||
import Button from "styles/common/Button";
|
import Button from "styles/common/Button";
|
||||||
import Icon from "styles/common/Icon";
|
import Icon from "styles/common/Icon";
|
||||||
import {
|
import {
|
||||||
|
EXTENSIONS_WITH_ICON,
|
||||||
ICON_CACHE,
|
ICON_CACHE,
|
||||||
ICON_CACHE_EXTENSION,
|
ICON_CACHE_EXTENSION,
|
||||||
ICON_PATH,
|
ICON_PATH,
|
||||||
|
|
@ -349,7 +350,7 @@ const FileEntry: FC<FileEntryProps> = ({
|
||||||
!isLoadingFileManager &&
|
!isLoadingFileManager &&
|
||||||
isVisible &&
|
isVisible &&
|
||||||
!isIconCached.current &&
|
!isIconCached.current &&
|
||||||
!detailsView
|
(!detailsView || EXTENSIONS_WITH_ICON.has(urlExt))
|
||||||
) {
|
) {
|
||||||
const updateIcon = async (): Promise<void> => {
|
const updateIcon = async (): Promise<void> => {
|
||||||
if (icon.startsWith("blob:") || icon.startsWith("data:")) {
|
if (icon.startsWith("blob:") || icon.startsWith("data:")) {
|
||||||
|
|
@ -506,9 +507,7 @@ const FileEntry: FC<FileEntryProps> = ({
|
||||||
updateIcon();
|
updateIcon();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isVisible && getIconAbortController.current) {
|
if (!isVisible) getIconAbortController.current?.abort();
|
||||||
getIconAbortController.current.abort();
|
|
||||||
}
|
|
||||||
}, [
|
}, [
|
||||||
detailsView,
|
detailsView,
|
||||||
exists,
|
exists,
|
||||||
|
|
|
||||||
|
|
@ -274,13 +274,14 @@ export const VIDEO_FILE_EXTENSIONS = new Set([
|
||||||
|
|
||||||
export const DYNAMIC_PREFIX = ["nostr:"];
|
export const DYNAMIC_PREFIX = ["nostr:"];
|
||||||
|
|
||||||
|
export const EXTENSIONS_WITH_ICON = new Set([".ani", ".cur", ".exe", ".ico"]);
|
||||||
|
|
||||||
export const DYNAMIC_EXTENSION = new Set([
|
export const DYNAMIC_EXTENSION = new Set([
|
||||||
...AUDIO_FILE_EXTENSIONS,
|
...AUDIO_FILE_EXTENSIONS,
|
||||||
...AUDIO_PLAYLIST_EXTENSIONS,
|
...AUDIO_PLAYLIST_EXTENSIONS,
|
||||||
...IMAGE_FILE_EXTENSIONS,
|
...IMAGE_FILE_EXTENSIONS,
|
||||||
...TIFF_IMAGE_FORMATS,
|
...TIFF_IMAGE_FORMATS,
|
||||||
...VIDEO_FILE_EXTENSIONS,
|
...VIDEO_FILE_EXTENSIONS,
|
||||||
".ani",
|
|
||||||
".exe",
|
".exe",
|
||||||
".mp3",
|
".mp3",
|
||||||
".sav",
|
".sav",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user