From 2f3b6b29ae03395010720d49f9b18c3f1f48ccbe Mon Sep 17 00:00:00 2001 From: GyDi Date: Tue, 5 Jul 2022 01:24:23 +0800 Subject: [PATCH] fix: rm macOS transition props --- src/components/profile/enhanced.tsx | 6 ------ src/components/profile/profile-item.tsx | 6 ------ src/components/profile/profile-more.tsx | 6 ------ src/components/setting/core-switch.tsx | 9 ++------- 4 files changed, 2 insertions(+), 25 deletions(-) diff --git a/src/components/profile/enhanced.tsx b/src/components/profile/enhanced.tsx index a574361..0105bea 100644 --- a/src/components/profile/enhanced.tsx +++ b/src/components/profile/enhanced.tsx @@ -26,7 +26,6 @@ import { changeProfileValid, } from "../../services/cmds"; import { CmdType } from "../../services/types"; -import getSystem from "../../utils/get-system"; import ProfileMore from "./profile-more"; import Notice from "../base/base-notice"; @@ -35,8 +34,6 @@ interface Props { chain: string[]; } -const OS = getSystem(); - const EnhancedMode = (props: Props) => { const { items, chain } = props; @@ -147,9 +144,6 @@ const EnhancedMode = (props: Props) => { anchorEl={anchorEl} onClose={() => setAnchorEl(null)} transitionDuration={225} - TransitionProps={ - OS === "macos" ? { style: { transitionDuration: "225ms" } } : {} - } MenuListProps={{ dense: true, "aria-labelledby": "profile-use-button", diff --git a/src/components/profile/profile-item.tsx b/src/components/profile/profile-item.tsx index ca2f0df..c7a13c7 100644 --- a/src/components/profile/profile-item.tsx +++ b/src/components/profile/profile-item.tsx @@ -20,7 +20,6 @@ import { CmdType } from "../../services/types"; import { atomLoadingCache } from "../../services/states"; import { updateProfile, deleteProfile, viewProfile } from "../../services/cmds"; import parseTraffic from "../../utils/parse-traffic"; -import getSystem from "../../utils/get-system"; import ProfileEdit from "./profile-edit"; import FileEditor from "./file-editor"; import Notice from "../base/base-notice"; @@ -41,8 +40,6 @@ const round = keyframes` to { transform: rotate(360deg); } `; -const OS = getSystem(); - interface Props { selected: boolean; itemData: CmdType.ProfileItem; @@ -302,9 +299,6 @@ const ProfileItem = (props: Props) => { anchorPosition={position} anchorReference="anchorPosition" transitionDuration={225} - TransitionProps={ - OS === "macos" ? { style: { transitionDuration: "225ms" } } : {} - } onContextMenu={(e) => { setAnchorEl(null); e.preventDefault(); diff --git a/src/components/profile/profile-more.tsx b/src/components/profile/profile-more.tsx index 2ead76a..15129d5 100644 --- a/src/components/profile/profile-more.tsx +++ b/src/components/profile/profile-more.tsx @@ -13,7 +13,6 @@ import { } from "@mui/material"; import { CmdType } from "../../services/types"; import { viewProfile } from "../../services/cmds"; -import getSystem from "../../utils/get-system"; import enhance from "../../services/enhance"; import ProfileEdit from "./profile-edit"; import FileEditor from "./file-editor"; @@ -30,8 +29,6 @@ const Wrapper = styled(Box)(({ theme }) => ({ boxSizing: "border-box", })); -const OS = getSystem(); - interface Props { selected: boolean; itemData: CmdType.ProfileItem; @@ -223,9 +220,6 @@ const ProfileMore = (props: Props) => { anchorPosition={position} anchorReference="anchorPosition" transitionDuration={225} - TransitionProps={ - OS === "macos" ? { style: { transitionDuration: "225ms" } } : {} - } onContextMenu={(e) => { setAnchorEl(null); e.preventDefault(); diff --git a/src/components/setting/core-switch.tsx b/src/components/setting/core-switch.tsx index b7ebd08..db70436 100644 --- a/src/components/setting/core-switch.tsx +++ b/src/components/setting/core-switch.tsx @@ -4,11 +4,9 @@ import { useLockFn } from "ahooks"; import { Menu, MenuItem } from "@mui/material"; import { Settings } from "@mui/icons-material"; import { changeClashCore, getVergeConfig } from "../../services/cmds"; -import getSystem from "../../utils/get-system"; +import { getVersion } from "../../services/api"; import Notice from "../base/base-notice"; -const OS = getSystem(); - const VALID_CORE = [ { name: "Clash", core: "clash" }, { name: "Clash Meta", core: "clash-meta" }, @@ -31,7 +29,7 @@ const CoreSwitch = () => { await changeClashCore(core); mutate("getVergeConfig"); mutate("getClashConfig"); - mutate("getVersion"); + mutate("getVersion", getVersion()); setAnchorEl(null); Notice.success(`Successfully switch to ${core}`, 1000); } catch (err: any) { @@ -58,9 +56,6 @@ const CoreSwitch = () => { anchorPosition={position} anchorReference="anchorPosition" transitionDuration={225} - TransitionProps={ - OS === "macos" ? { style: { transitionDuration: "225ms" } } : {} - } onContextMenu={(e) => { setAnchorEl(null); e.preventDefault();