Skip to content
Snippets Groups Projects
Unverified Commit f6e821ba authored by GyDi's avatar GyDi
Browse files

feat: adjust clash version display

parent e8dbcf81
No related branches found
No related tags found
No related merge requests found
...@@ -25,6 +25,7 @@ interface Props { ...@@ -25,6 +25,7 @@ interface Props {
const SettingClash = ({ onError }: Props) => { const SettingClash = ({ onError }: Props) => {
const { mutate } = useSWRConfig(); const { mutate } = useSWRConfig();
const { data: clashConfig } = useSWR("getClashConfig", getClashConfig); const { data: clashConfig } = useSWR("getClashConfig", getClashConfig);
const { data: versionData } = useSWR("getVersion", getVersion);
const { const {
ipv6 = false, ipv6 = false,
...@@ -70,12 +71,9 @@ const SettingClash = ({ onError }: Props) => { ...@@ -70,12 +71,9 @@ const SettingClash = ({ onError }: Props) => {
); );
// get clash core version // get clash core version
const [clashVer, setClashVer] = useState(""); const clashVer = versionData?.premium
useEffect(() => { ? `${versionData.version} Premium`
getVersion().then(({ premium, version }) => { : versionData?.version || "-";
setClashVer(premium ? `${version} Premium` : version);
});
}, []);
return ( return (
<SettingList title="Clash Setting"> <SettingList title="Clash Setting">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment