refactor: improve code readability and consistency in proxy-chain and uri-parser utilities
refactor: add keys to icons in routers for improved rendering and performance refactor: optimize RegExp polyfill by using Object.prototype.hasOwnProperty.call refactor: reorder imports in chain-proxy-provider for consistency refactor: remove unused "obfs-opts" property from IProxySnellConfig interface refactor: reorganize imports and enhance refresh logic in app data provider refactor: re-enable prop-types linting for better type safety in BaseDialog component refactor: update dependencies in effect hooks for improved stability and performance
This commit is contained in:
@@ -12,20 +12,18 @@ import { useClashInfo } from "@/hooks/use-clash";
|
||||
import { useVerge } from "@/hooks/use-verge";
|
||||
import { useVisibility } from "@/hooks/use-visibility";
|
||||
import {
|
||||
getProxies,
|
||||
getRules,
|
||||
forceRefreshProxies,
|
||||
getAppUptime,
|
||||
getClashConfig,
|
||||
getConnections,
|
||||
getMemoryData,
|
||||
getProxies,
|
||||
getProxyProviders,
|
||||
getRuleProviders,
|
||||
getConnections,
|
||||
getTrafficData,
|
||||
getMemoryData,
|
||||
} from "@/services/cmds";
|
||||
import {
|
||||
getSystemProxy,
|
||||
getRules,
|
||||
getRunningMode,
|
||||
getAppUptime,
|
||||
forceRefreshProxies,
|
||||
getSystemProxy,
|
||||
getTrafficData,
|
||||
} from "@/services/cmds";
|
||||
|
||||
// 连接速度计算接口
|
||||
@@ -482,7 +480,7 @@ export const AppDataProvider = ({
|
||||
);
|
||||
|
||||
// 提供统一的刷新方法
|
||||
const refreshAll = async () => {
|
||||
const refreshAll = React.useCallback(async () => {
|
||||
await Promise.all([
|
||||
refreshProxy(),
|
||||
refreshClashConfig(),
|
||||
@@ -491,7 +489,14 @@ export const AppDataProvider = ({
|
||||
refreshProxyProviders(),
|
||||
refreshRuleProviders(),
|
||||
]);
|
||||
};
|
||||
}, [
|
||||
refreshProxy,
|
||||
refreshClashConfig,
|
||||
refreshRules,
|
||||
refreshSysproxy,
|
||||
refreshProxyProviders,
|
||||
refreshRuleProviders,
|
||||
]);
|
||||
|
||||
// 聚合所有数据
|
||||
const value = useMemo(() => {
|
||||
@@ -581,6 +586,7 @@ export const AppDataProvider = ({
|
||||
refreshSysproxy,
|
||||
refreshProxyProviders,
|
||||
refreshRuleProviders,
|
||||
refreshAll,
|
||||
]);
|
||||
|
||||
return (
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { createContext, useContext, useState, useCallback } from "react";
|
||||
import React, { createContext, useCallback, useContext, useState } from "react";
|
||||
|
||||
interface ChainProxyContextType {
|
||||
isChainMode: boolean;
|
||||
|
||||
Reference in New Issue
Block a user