mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2024-11-15 19:22:26 +08:00
fix: await compatibility in #8e78b9e
This commit is contained in:
parent
8e78b9e405
commit
66ae293ddd
|
@ -12,11 +12,11 @@ interface Props extends IconButtonProps {
|
|||
}
|
||||
|
||||
export const TooltipIcon: React.FC<Props> = (props: Props) => {
|
||||
const { title = "", icon: Icon = InfoRounded } = props;
|
||||
const { title = "", icon: Icon = InfoRounded, ...restProps } = props;
|
||||
|
||||
return (
|
||||
<Tooltip title={title} placement="top">
|
||||
<IconButton color="inherit" size="small" {...props}>
|
||||
<IconButton color="inherit" size="small" {...restProps}>
|
||||
<Icon fontSize="inherit" style={{ cursor: "pointer", opacity: 0.75 }} />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { useRef } from "react";
|
||||
import { useEffect, useRef, useState } from "react";
|
||||
import { Box, Typography } from "@mui/material";
|
||||
import {
|
||||
ArrowDownward,
|
||||
|
@ -21,8 +21,6 @@ interface MemoryUsage {
|
|||
oslimit?: number;
|
||||
}
|
||||
|
||||
const isDebug = await isDebugEnabled();
|
||||
|
||||
// setup the traffic
|
||||
export const LayoutTraffic = () => {
|
||||
const { t } = useTranslation();
|
||||
|
@ -34,6 +32,12 @@ export const LayoutTraffic = () => {
|
|||
|
||||
const trafficRef = useRef<TrafficRef>(null);
|
||||
const pageVisible = useVisibility();
|
||||
const [isDebug, setIsDebug] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
isDebugEnabled().then((flag) => setIsDebug(flag));
|
||||
return () => {};
|
||||
}, [isDebug]);
|
||||
|
||||
// https://swr.vercel.app/docs/subscription#deduplication
|
||||
// useSWRSubscription auto deduplicates to one subscription per key per entire app
|
||||
|
|
Loading…
Reference in New Issue
Block a user