From c200e18434bde35c87c53a6408907dc8e827c417 Mon Sep 17 00:00:00 2001 From: MystiPanda Date: Thu, 21 Mar 2024 20:29:16 +0800 Subject: [PATCH] fix: Duplicate icon display error #719 --- src/components/proxy/proxy-render.tsx | 3 ++- src/components/test/test-item.tsx | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/proxy/proxy-render.tsx b/src/components/proxy/proxy-render.tsx index e9bad1fb..eefb41e8 100644 --- a/src/components/proxy/proxy-render.tsx +++ b/src/components/proxy/proxy-render.tsx @@ -49,7 +49,8 @@ export const ProxyRender = (props: RenderProps) => { async function initIconCachePath() { if (group.icon && group.icon.trim().startsWith("http")) { - const fileName = getFileName(group.icon); + const fileName = + group.name.replaceAll(" ", "") + "-" + getFileName(group.icon); const iconPath = await downloadIconCache(group.icon, fileName); setIconCachePath(convertFileSrc(iconPath)); } diff --git a/src/components/test/test-item.tsx b/src/components/test/test-item.tsx index 883d4e7e..717d2bc3 100644 --- a/src/components/test/test-item.tsx +++ b/src/components/test/test-item.tsx @@ -18,7 +18,7 @@ import { Notice } from "@/components/base"; import { TestBox } from "./test-box"; import delayManager from "@/services/delay"; import { cmdTestDelay, downloadIconCache } from "@/services/cmds"; -import { listen, Event, UnlistenFn } from "@tauri-apps/api/event"; +import { listen, UnlistenFn } from "@tauri-apps/api/event"; import { convertFileSrc } from "@tauri-apps/api/tauri"; interface Props { @@ -48,7 +48,7 @@ export const TestItem = (props: Props) => { async function initIconCachePath() { if (icon && icon.trim().startsWith("http")) { - const fileName = getFileName(icon); + const fileName = uid + "-" + getFileName(icon); const iconPath = await downloadIconCache(icon, fileName); setIconCachePath(convertFileSrc(iconPath)); }