diff --git a/src/components/profile/profile-more.tsx b/src/components/profile/profile-more.tsx index 2633129..03d6263 100644 --- a/src/components/profile/profile-more.tsx +++ b/src/components/profile/profile-more.tsx @@ -36,6 +36,7 @@ interface Props { onMoveTop: () => void; onMoveEnd: () => void; onDelete: () => void; + onEnhance: () => void; } // profile enhanced item @@ -48,6 +49,7 @@ const ProfileMore = (props: Props) => { onMoveTop, onMoveEnd, onDelete, + onEnhance, } = props; const { type } = itemData; @@ -76,8 +78,9 @@ const ProfileMore = (props: Props) => { const enableMenu = [ { label: "Disable", handler: closeWrapper(onDisable) }, + { label: "Refresh", handler: closeWrapper(onEnhance) }, { label: "Edit", handler: onEdit }, - { label: "View File", handler: onView }, + { label: "View", handler: onView }, { label: "To Top", handler: closeWrapper(onMoveTop) }, { label: "To End", handler: closeWrapper(onMoveEnd) }, { label: "Delete", handler: closeWrapper(onDelete) }, @@ -86,7 +89,7 @@ const ProfileMore = (props: Props) => { const disableMenu = [ { label: "Enable", handler: closeWrapper(onEnable) }, { label: "Edit", handler: onEdit }, - { label: "View File", handler: onView }, + { label: "View", handler: onView }, { label: "Delete", handler: closeWrapper(onDelete) }, ]; diff --git a/src/pages/profiles.tsx b/src/pages/profiles.tsx index 3caee2a..db456e4 100644 --- a/src/pages/profiles.tsx +++ b/src/pages/profiles.tsx @@ -8,6 +8,7 @@ import { deleteProfile, selectProfile, importProfile, + enhanceProfiles, changeProfileChain, } from "../services/cmds"; import { getProxies, updateProxy } from "../services/api"; @@ -126,6 +127,8 @@ const ProfilePage = () => { const chain = profiles.chain || []; + const onEnhance = useLockFn(enhanceProfiles); + const onEnhanceEnable = useLockFn(async (uid: string) => { if (chain.includes(uid)) return; @@ -217,6 +220,7 @@ const ProfilePage = () => { onDelete={() => onEnhanceDelete(item.uid)} onMoveTop={() => onMoveTop(item.uid)} onMoveEnd={() => onMoveEnd(item.uid)} + onEnhance={onEnhance} /> ))} diff --git a/src/services/enhance.ts b/src/services/enhance.ts index 7bd9ff7..ac4b946 100644 --- a/src/services/enhance.ts +++ b/src/services/enhance.ts @@ -93,6 +93,4 @@ export default function setup() { emit(payload.callback, JSON.stringify(result)).catch(console.error); }); - - // enhanceProfiles(); }