mirror of
https://github.com/DustinBrett/daedalOS.git
synced 2025-12-06 00:20:05 +01:00
This commit is contained in:
parent
93dc4bdd30
commit
7799403591
|
|
@ -181,6 +181,7 @@ const FileEntry: FC<FileEntryProps> = ({
|
||||||
const [showInFileManager, setShowInFileManager] = useState(false);
|
const [showInFileManager, setShowInFileManager] = useState(false);
|
||||||
const { formats, sizes } = useTheme();
|
const { formats, sizes } = useTheme();
|
||||||
const listView = useMemo(() => view === "list", [view]);
|
const listView = useMemo(() => view === "list", [view]);
|
||||||
|
const detailsView = useMemo(() => view === "details", [view]);
|
||||||
const fileName = useMemo(() => basename(path), [path]);
|
const fileName = useMemo(() => basename(path), [path]);
|
||||||
const urlExt = useMemo(
|
const urlExt = useMemo(
|
||||||
() => (isDirectory ? "" : getExtension(url)),
|
() => (isDirectory ? "" : getExtension(url)),
|
||||||
|
|
@ -306,8 +307,8 @@ const FileEntry: FC<FileEntryProps> = ({
|
||||||
urlExt,
|
urlExt,
|
||||||
]);
|
]);
|
||||||
const showColumn = useMemo(
|
const showColumn = useMemo(
|
||||||
() => isVisible && columns !== undefined && view === "details",
|
() => isVisible && columns !== undefined && detailsView,
|
||||||
[columns, isVisible, view]
|
[columns, detailsView, isVisible]
|
||||||
);
|
);
|
||||||
const columnWidth = useMemo(
|
const columnWidth = useMemo(
|
||||||
() =>
|
() =>
|
||||||
|
|
@ -344,7 +345,12 @@ const FileEntry: FC<FileEntryProps> = ({
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!isLoadingFileManager && isVisible && !isIconCached.current) {
|
if (
|
||||||
|
!isLoadingFileManager &&
|
||||||
|
isVisible &&
|
||||||
|
!isIconCached.current &&
|
||||||
|
!detailsView
|
||||||
|
) {
|
||||||
const updateIcon = async (): Promise<void> => {
|
const updateIcon = async (): Promise<void> => {
|
||||||
if (icon.startsWith("blob:") || icon.startsWith("data:")) {
|
if (icon.startsWith("blob:") || icon.startsWith("data:")) {
|
||||||
if (icon.startsWith("data:image/jpeg;base64,")) return;
|
if (icon.startsWith("data:image/jpeg;base64,")) return;
|
||||||
|
|
@ -504,6 +510,7 @@ const FileEntry: FC<FileEntryProps> = ({
|
||||||
getIconAbortController.current.abort();
|
getIconAbortController.current.abort();
|
||||||
}
|
}
|
||||||
}, [
|
}, [
|
||||||
|
detailsView,
|
||||||
exists,
|
exists,
|
||||||
fs,
|
fs,
|
||||||
getIcon,
|
getIcon,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user