mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2024-11-16 03:32:36 +08:00
feat: adjust clash version display
This commit is contained in:
parent
e8dbcf819b
commit
f6e821ba6b
|
@ -25,6 +25,7 @@ interface Props {
|
|||
const SettingClash = ({ onError }: Props) => {
|
||||
const { mutate } = useSWRConfig();
|
||||
const { data: clashConfig } = useSWR("getClashConfig", getClashConfig);
|
||||
const { data: versionData } = useSWR("getVersion", getVersion);
|
||||
|
||||
const {
|
||||
ipv6 = false,
|
||||
|
@ -70,12 +71,9 @@ const SettingClash = ({ onError }: Props) => {
|
|||
);
|
||||
|
||||
// get clash core version
|
||||
const [clashVer, setClashVer] = useState("");
|
||||
useEffect(() => {
|
||||
getVersion().then(({ premium, version }) => {
|
||||
setClashVer(premium ? `${version} Premium` : version);
|
||||
});
|
||||
}, []);
|
||||
const clashVer = versionData?.premium
|
||||
? `${versionData.version} Premium`
|
||||
: versionData?.version || "-";
|
||||
|
||||
return (
|
||||
<SettingList title="Clash Setting">
|
||||
|
|
Loading…
Reference in New Issue
Block a user