Use same icon for file and shortcut
Some checks are pending
Tests / tests (push) Waiting to run

This commit is contained in:
Dustin Brett 2024-11-28 21:45:49 -08:00
parent 06820210ab
commit 5bac2dd623

View File

@ -365,18 +365,25 @@ export const getInfoWithExtension = (
if (pid !== "ExternalURL") subIcons.push(SHORTCUT_ICON);
if (pid === "FileExplorer" && !icon) {
const getIcon = (): void => {
getIconFromIni(fs, url).then(
(iniIcon) =>
iniIcon &&
const iconCallback = (newIcon?: string): void => {
if (!newIcon) return;
callback({
comment,
icon: iniIcon,
icon: newIcon,
pid,
subIcons,
url,
})
});
};
const getIcon = (): void => {
if (urlExt) {
getInfoWithExtension(fs, url, urlExt, ({ icon: extIcon }) =>
iconCallback(extIcon)
);
} else {
getIconFromIni(fs, url).then(iconCallback);
}
};
callback({
@ -479,6 +486,24 @@ export const getInfoWithExtension = (
} else {
callback({
comment,
getIcon:
icon && icon === processDirectory[pid]?.icon
? () =>
getInfoWithExtension(
fs,
url,
urlExt,
({ icon: extIcon }) =>
extIcon &&
callback({
comment,
icon: extIcon,
pid,
subIcons,
url,
})
)
: undefined,
icon: icon || UNKNOWN_ICON_PATH,
pid,
subIcons,