mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-03 05:22:09 +08:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
84d8f702af | ||
|
|
067a9f7cad |
Generated
+1
-1
@@ -1081,7 +1081,7 @@ checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "clash-verge"
|
name = "clash-verge"
|
||||||
version = "2.5.10"
|
version = "2.5.9-rc"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aes-gcm",
|
"aes-gcm",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
|||||||
+26
-25
@@ -1,45 +1,46 @@
|
|||||||
<!-- Release-notes skeleton. Entries accumulate in ./Changelog.md as PRs land;
|
## v2.5.9
|
||||||
before publishing a release, distill them:
|
|
||||||
- user-visible changes only — no dev tooling, CI fixes, or refactors whose
|
- **Mihomo(Meta) 内核升级至 v1.19.33**
|
||||||
effect is already covered by another entry
|
|
||||||
- describe outcomes, not internals: no internal module names, IPC or
|
|
||||||
protocol details, or implementation mechanics — write what the user
|
|
||||||
observes, not how the code achieves it
|
|
||||||
- one line per theme: merge entries that share a root cause
|
|
||||||
- each entry fits a single readable line (about 60 CJK characters); if it
|
|
||||||
overflows, it is packing multiple themes or detail that belongs in the
|
|
||||||
linked issue/PR — split it or drop the detail
|
|
||||||
- line grammar: open with a verb (修复/新增/优化), with the platform
|
|
||||||
first (Windows/macOS/Linux) when the change is platform-specific;
|
|
||||||
merge sub-symptoms as 主题:症状、症状; full-width punctuation,
|
|
||||||
「」 for UI labels, backticks for config keys and commands
|
|
||||||
- platform entries sit under their platform heading (bold, emoji
|
|
||||||
prefixed, ordered Windows/macOS/Linux, combined for pairs like
|
|
||||||
macOS/Linux) at the end of their section;
|
|
||||||
scripts-workflow/group_platforms.sh regroups, --check verifies
|
|
||||||
HTML comments are stripped by the update dialog's sanitizer and hidden on
|
|
||||||
GitHub, so they never reach users. -->
|
|
||||||
## v2.5.10
|
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary><strong> 🐞 修复问题 </strong></summary>
|
<summary><strong> 🐞 修复问题 </strong></summary>
|
||||||
|
|
||||||
- 修复全局模式缺少 `GLOBAL` 策略组,无法单独选择全局出口
|
- 修复规则扩展包含空列表项时,「编辑规则」界面报错的问题
|
||||||
|
- 修复 重启应用后定时自动备份不执行的问题
|
||||||
|
- 修复托盘测速与代理页行为不一致的问题,移除托盘「测试延迟」入口
|
||||||
|
- 修复通过 URL 导入订阅时,即使导入的订阅并非当前使用的订阅,也会重新加载当前配置
|
||||||
|
- 修复 首页 网站测速失败后卡片一直显示测试中
|
||||||
|
- 修复 代理 页展开分组后不显示最新测速结果,需切换节点才刷新
|
||||||
|
- 修复 代理 在全局模式下无法展开节点组
|
||||||
|
- 修复 自定义 CSS 无法修改编辑器字体和字号的问题
|
||||||
|
- 修复 WebDAV 设置清空后无法保存
|
||||||
|
|
||||||
**🖥️ Windows**
|
**🍎 macOS**
|
||||||
|
|
||||||
- Windows:修复安装程序重新安装或覆盖时未提示退出运行中应用,导致卸载报错或覆盖失败的问题
|
- macOS:修复 Bigsur 上首页测速和流量图无法显示的问题
|
||||||
|
|
||||||
|
**🐧 Linux**
|
||||||
|
|
||||||
|
- Linux:修复 deb/rpm 安装包错误包含多余的 `frontend-contract` 可执行文件,导致下游重新打包失败的问题
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary><strong> ✨ 新增功能 </strong></summary>
|
<summary><strong> ✨ 新增功能 </strong></summary>
|
||||||
|
|
||||||
|
- 新增虚拟网卡设置的「DNS 模式」选项,支持配置 mihomo 系统 DNS 行为
|
||||||
|
- 新增「IP 信息」自动刷新开关,关闭后仍可手动刷新
|
||||||
|
- 新增 Muse AI 解锁检测,针对 Muse AI 特有的 Cloudflare 人机验证增加「Risky」状态标记
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary><strong> 🚀 优化改进 </strong></summary>
|
<summary><strong> 🚀 优化改进 </strong></summary>
|
||||||
|
|
||||||
|
- 优化「链式代理」:开启前需确认网速影响提示,空面板新增「关闭」按钮
|
||||||
|
|
||||||
|
**🖥️ Windows**
|
||||||
|
|
||||||
|
- Windows 系统代理默认绕过 `*.local` 域名,访问局域网设备的 `.local` 主机名时不再经过代理
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|||||||
@@ -1,51 +1,3 @@
|
|||||||
## v2.5.9
|
|
||||||
|
|
||||||
- **Mihomo(Meta) 内核升级至 v1.19.33**
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary><strong> 🐞 修复问题 </strong></summary>
|
|
||||||
|
|
||||||
- 修复规则扩展包含空列表项时,「编辑规则」界面报错的问题
|
|
||||||
- 修复 重启应用后定时自动备份不执行的问题
|
|
||||||
- 修复托盘测速与代理页行为不一致的问题,移除托盘「测试延迟」入口
|
|
||||||
- 修复通过 URL 导入订阅时,即使导入的订阅并非当前使用的订阅,也会重新加载当前配置
|
|
||||||
- 修复 首页 网站测速失败后卡片一直显示测试中
|
|
||||||
- 修复 代理 页展开分组后不显示最新测速结果,需切换节点才刷新
|
|
||||||
- 修复 代理 在全局模式下无法展开节点组
|
|
||||||
- 修复 自定义 CSS 无法修改编辑器字体和字号的问题
|
|
||||||
- 修复 WebDAV 设置清空后无法保存
|
|
||||||
|
|
||||||
**🍎 macOS**
|
|
||||||
|
|
||||||
- macOS:修复 Bigsur 上首页测速和流量图无法显示的问题
|
|
||||||
|
|
||||||
**🐧 Linux**
|
|
||||||
|
|
||||||
- Linux:修复 deb/rpm 安装包错误包含多余的 `frontend-contract` 可执行文件,导致下游重新打包失败的问题
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary><strong> ✨ 新增功能 </strong></summary>
|
|
||||||
|
|
||||||
- 新增虚拟网卡设置的「DNS 模式」选项,支持配置 mihomo 系统 DNS 行为
|
|
||||||
- 新增「IP 信息」自动刷新开关,关闭后仍可手动刷新
|
|
||||||
- 新增 Muse AI 解锁检测,针对 Muse AI 特有的 Cloudflare 人机验证增加「Risky」状态标记
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary><strong> 🚀 优化改进 </strong></summary>
|
|
||||||
|
|
||||||
- 优化「链式代理」:开启前需确认网速影响提示,空面板新增「关闭」按钮
|
|
||||||
|
|
||||||
**🖥️ Windows**
|
|
||||||
|
|
||||||
- Windows 系统代理默认绕过 `*.local` 域名,访问局域网设备的 `.local` 主机名时不再经过代理
|
|
||||||
|
|
||||||
</details>
|
|
||||||
|
|
||||||
|
|
||||||
## v2.5.8
|
## v2.5.8
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "clash-verge",
|
"name": "clash-verge",
|
||||||
"version": "2.5.10",
|
"version": "2.5.9-rc",
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "husky || true",
|
"prepare": "husky || true",
|
||||||
|
|||||||
@@ -41,10 +41,7 @@ fi
|
|||||||
|
|
||||||
tmpfile=$(mktemp)
|
tmpfile=$(mktemp)
|
||||||
{
|
{
|
||||||
node -e '
|
cat "$CHANGELOG"
|
||||||
const fs = require("node:fs");
|
|
||||||
process.stdout.write(fs.readFileSync(process.argv[1], "utf8").replace(/<!--[\s\S]*?-->/g, "").trimStart());
|
|
||||||
' "$CHANGELOG"
|
|
||||||
echo
|
echo
|
||||||
echo ""
|
echo ""
|
||||||
if [ -f "$HISTORY" ]; then
|
if [ -f "$HISTORY" ]; then
|
||||||
|
|||||||
@@ -134,31 +134,6 @@ function fetchBranches() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
function discardClosedCandidate(branch, base, prefix) {
|
|
||||||
const candidates = list(
|
|
||||||
`pulls?state=all&base=${base}&head=${repository.split('/')[0]}:${branch}&per_page=100`,
|
|
||||||
)
|
|
||||||
const latest = candidates[0]
|
|
||||||
if (!latest || candidates.some((pr) => pr.state === 'open'))
|
|
||||||
throw new Error(
|
|
||||||
`Branch ${branch} is reserved by an active or unknown candidate.`,
|
|
||||||
)
|
|
||||||
const pr = get(`pulls/${latest.number}`)
|
|
||||||
requireBotPr(pr, base, prefix)
|
|
||||||
if (pr.state !== 'closed' || pr.merged)
|
|
||||||
throw new Error(
|
|
||||||
`Close the unmerged candidate before retrying: ${pr.html_url}`,
|
|
||||||
)
|
|
||||||
updateRefs(pr.base.repo.node_id, [
|
|
||||||
{
|
|
||||||
name: `refs/heads/${branch}`,
|
|
||||||
beforeOid: pr.head.sha,
|
|
||||||
afterOid: '0'.repeat(40),
|
|
||||||
},
|
|
||||||
])
|
|
||||||
summary(`Released the unused branch from closed PR: ${pr.html_url}`)
|
|
||||||
}
|
|
||||||
|
|
||||||
function prepare() {
|
function prepare() {
|
||||||
let refresh
|
let refresh
|
||||||
if (env.GITHUB_EVENT_NAME === 'pull_request_target') {
|
if (env.GITHUB_EVENT_NAME === 'pull_request_target') {
|
||||||
@@ -236,15 +211,8 @@ function prepare() {
|
|||||||
: last
|
: last
|
||||||
? `${base}-rc.${BigInt(last.match(rcPattern)[4] ?? 0) + 1n}`
|
? `${base}-rc.${BigInt(last.match(rcPattern)[4] ?? 0) + 1n}`
|
||||||
: `${base}-rc`)
|
: `${base}-rc`)
|
||||||
if (tags.includes(tag)) throw new Error(`Tag ${tag} already exists.`)
|
if (occupied.includes(tag))
|
||||||
for (const [prefix, target] of [
|
throw new Error(`Tag ${tag} already exists or is reserved.`)
|
||||||
['release/', 'dev'],
|
|
||||||
['publish/', 'main'],
|
|
||||||
]) {
|
|
||||||
const branch = `${prefix}${tag}`
|
|
||||||
if (refs.includes(`refs/heads/${branch}`) && branch !== refresh?.head.ref)
|
|
||||||
discardClosedCandidate(branch, target, prefix)
|
|
||||||
}
|
|
||||||
const sha = git('rev-parse', 'HEAD')
|
const sha = git('rev-parse', 'HEAD')
|
||||||
const body = releaseBody(tag, sha, tags, false)
|
const body = releaseBody(tag, sha, tags, false)
|
||||||
summary(body)
|
summary(body)
|
||||||
@@ -485,7 +453,7 @@ function publishPr() {
|
|||||||
validateVersionCommit(tag, sha)
|
validateVersionCommit(tag, sha)
|
||||||
const branch = `publish/${tag}`
|
const branch = `publish/${tag}`
|
||||||
const existing = list(
|
const existing = list(
|
||||||
`pulls?state=open&base=main&head=${repository.split('/')[0]}:${branch}&per_page=100`,
|
`pulls?state=all&base=main&head=${repository.split('/')[0]}:${branch}&per_page=100`,
|
||||||
)
|
)
|
||||||
if (existing.length) {
|
if (existing.length) {
|
||||||
const publication = existing[0]
|
const publication = existing[0]
|
||||||
@@ -599,31 +567,28 @@ function publish() {
|
|||||||
requireApproval(pr, sha)
|
requireApproval(pr, sha)
|
||||||
const main = git('rev-parse', 'origin/main')
|
const main = git('rev-parse', 'origin/main')
|
||||||
git('merge-base', '--is-ancestor', main, sha)
|
git('merge-base', '--is-ancestor', main, sha)
|
||||||
git(
|
const object = api('git/tags', {
|
||||||
'-c',
|
|
||||||
'user.name=github-actions[bot]',
|
|
||||||
'-c',
|
|
||||||
'user.email=41898282+github-actions[bot]@users.noreply.github.com',
|
|
||||||
'tag',
|
|
||||||
'--annotate',
|
|
||||||
'--no-sign',
|
|
||||||
'--message',
|
|
||||||
marker,
|
|
||||||
tag,
|
tag,
|
||||||
sha,
|
message: marker,
|
||||||
)
|
object: sha,
|
||||||
// GraphQL updateRefs rejects annotated tag objects; Git preserves atomicity.
|
type: 'commit',
|
||||||
git(
|
})
|
||||||
'push',
|
// The tag records run ownership in the same transaction as the fast-forward.
|
||||||
'--atomic',
|
updateRefs(pr.base.repo.node_id, [
|
||||||
`--force-with-lease=refs/heads/main:${main}`,
|
{ name: 'refs/heads/main', beforeOid: main, afterOid: sha, force: false },
|
||||||
`--force-with-lease=refs/heads/${pr.head.ref}:${sha}`,
|
{
|
||||||
`--force-with-lease=refs/tags/${tag}:`,
|
name: `refs/heads/${pr.head.ref}`,
|
||||||
'origin',
|
beforeOid: sha,
|
||||||
`${sha}:refs/heads/main`,
|
afterOid: sha,
|
||||||
`${sha}:refs/heads/${pr.head.ref}`,
|
force: false,
|
||||||
`refs/tags/${tag}:refs/tags/${tag}`,
|
},
|
||||||
)
|
{
|
||||||
|
name: `refs/tags/${tag}`,
|
||||||
|
beforeOid: '0'.repeat(40),
|
||||||
|
afterOid: object.sha,
|
||||||
|
force: false,
|
||||||
|
},
|
||||||
|
])
|
||||||
summary(`Fast-forwarded main and tagged ${tag} at approved commit ${sha}.`)
|
summary(`Fast-forwarded main and tagged ${tag} at approved commit ${sha}.`)
|
||||||
}
|
}
|
||||||
releaseOutput(tag, sha)
|
releaseOutput(tag, sha)
|
||||||
@@ -652,14 +617,9 @@ function validateTag() {
|
|||||||
function prepareDraft() {
|
function prepareDraft() {
|
||||||
const tag = env.RELEASE_TAG
|
const tag = env.RELEASE_TAG
|
||||||
verifyTarget()
|
verifyTarget()
|
||||||
const result = run('gh', [
|
const release = list('releases?per_page=100').find(
|
||||||
'api',
|
(release) => release.tag_name === tag,
|
||||||
'--paginate',
|
)
|
||||||
endpoint('releases?per_page=100'),
|
|
||||||
'--jq',
|
|
||||||
`.[] | select(.tag_name == ${JSON.stringify(tag)}) | {id, draft}`,
|
|
||||||
])
|
|
||||||
const release = result ? JSON.parse(result) : null
|
|
||||||
if (release && !release.draft)
|
if (release && !release.draft)
|
||||||
throw new Error('This release is already public.')
|
throw new Error('This release is already public.')
|
||||||
const draft =
|
const draft =
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "clash-verge"
|
name = "clash-verge"
|
||||||
version = "2.5.10"
|
version = "2.5.9-rc"
|
||||||
description = "clash verge"
|
description = "clash verge"
|
||||||
authors = ["zzzgydi", "Tunglies", "wonfen", "MystiPanda"]
|
authors = ["zzzgydi", "Tunglies", "wonfen", "MystiPanda"]
|
||||||
license = "GPL-3.0-only"
|
license = "GPL-3.0-only"
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ ManifestDPIAwareness PerMonitorV2
|
|||||||
!include "FileAssociation.nsh"
|
!include "FileAssociation.nsh"
|
||||||
!include "Win\COM.nsh"
|
!include "Win\COM.nsh"
|
||||||
!include "Win\Propkey.nsh"
|
!include "Win\Propkey.nsh"
|
||||||
!include "Win\RestartManager.nsh"
|
|
||||||
!include "WinVer.nsh"
|
!include "WinVer.nsh"
|
||||||
!include "LogicLib.nsh"
|
!include "LogicLib.nsh"
|
||||||
!include "StrFunc.nsh"
|
!include "StrFunc.nsh"
|
||||||
@@ -333,8 +332,6 @@ Function PageLeaveReinstall
|
|||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
reinst_uninstall:
|
reinst_uninstall:
|
||||||
!insertmacro CheckIfAppIsRunning "$INSTDIR\${MAINBINARYNAME}.exe" "${PRODUCTNAME}"
|
|
||||||
|
|
||||||
HideWindow
|
HideWindow
|
||||||
ClearErrors
|
ClearErrors
|
||||||
|
|
||||||
@@ -371,10 +368,7 @@ Function PageLeaveReinstall
|
|||||||
MessageBox MB_ICONEXCLAMATION "$(unableToUninstall)"
|
MessageBox MB_ICONEXCLAMATION "$(unableToUninstall)"
|
||||||
Abort
|
Abort
|
||||||
${EndIf}
|
${EndIf}
|
||||||
Return
|
|
||||||
|
|
||||||
reinst_done:
|
reinst_done:
|
||||||
!insertmacro CheckIfAppIsRunning "$INSTDIR\${MAINBINARYNAME}.exe" "${PRODUCTNAME}"
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
; 5. Choose install directory page
|
; 5. Choose install directory page
|
||||||
@@ -907,7 +901,8 @@ Section Install
|
|||||||
|
|
||||||
nsExec::Exec 'netsh int tcp res'
|
nsExec::Exec 'netsh int tcp res'
|
||||||
|
|
||||||
!insertmacro CheckIfAppIsRunning "$INSTDIR\${MAINBINARYNAME}.exe" "${PRODUCTNAME}"
|
!include "Win\RestartManager.nsh"
|
||||||
|
!insertmacro CheckIfAppIsRunning "${MAINBINARYNAME}.exe" "${PRODUCTNAME}"
|
||||||
!insertmacro CheckAllVergeProcesses
|
!insertmacro CheckAllVergeProcesses
|
||||||
|
|
||||||
; Ensure startup folders exist
|
; Ensure startup folders exist
|
||||||
@@ -1106,7 +1101,7 @@ Section Uninstall
|
|||||||
!insertmacro NSIS_HOOK_PREUNINSTALL
|
!insertmacro NSIS_HOOK_PREUNINSTALL
|
||||||
!endif
|
!endif
|
||||||
|
|
||||||
!insertmacro CheckIfAppIsRunning "$INSTDIR\${MAINBINARYNAME}.exe" "${PRODUCTNAME}"
|
!insertmacro CheckIfAppIsRunning "${MAINBINARYNAME}.exe" "${PRODUCTNAME}"
|
||||||
!insertmacro CheckAllVergeProcesses
|
!insertmacro CheckAllVergeProcesses
|
||||||
!insertmacro RemoveVergeService
|
!insertmacro RemoveVergeService
|
||||||
|
|
||||||
|
|||||||
@@ -316,7 +316,6 @@ pub async fn hide() {
|
|||||||
{
|
{
|
||||||
let _ = window.hide();
|
let _ = window.hide();
|
||||||
}
|
}
|
||||||
handle::Handle::global().set_activation_policy_accessory();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|||||||
@@ -289,9 +289,6 @@ pub fn run() -> std::process::ExitCode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn handle_window_close(api: &tauri::WindowEvent) {
|
pub fn handle_window_close(api: &tauri::WindowEvent) {
|
||||||
#[cfg(target_os = "macos")]
|
|
||||||
handle::Handle::global().set_activation_policy_accessory();
|
|
||||||
|
|
||||||
if core::handle::Handle::global().is_exiting() {
|
if core::handle::Handle::global().is_exiting() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": "2.5.10",
|
"version": "2.5.9-rc",
|
||||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||||
"bundle": {
|
"bundle": {
|
||||||
"active": true,
|
"active": true,
|
||||||
|
|||||||
@@ -206,20 +206,17 @@ export const useRenderList = (
|
|||||||
verge?.default_latency_timeout,
|
verge?.default_latency_timeout,
|
||||||
])
|
])
|
||||||
|
|
||||||
const renderGroups = useMemo(() => {
|
|
||||||
if (!proxyView) return []
|
|
||||||
if (mode === 'rule') return proxyView.groups
|
|
||||||
const global = proxyView.global ? [proxyView.global] : []
|
|
||||||
return mode === 'global' ? [...global, ...proxyView.groups] : global
|
|
||||||
}, [mode, proxyView])
|
|
||||||
|
|
||||||
// Every group this list draws, so a test settling in any of them re-sorts that group.
|
// Every group this list draws, so a test settling in any of them re-sorts that group.
|
||||||
const renderedGroupNames = useMemo(() => {
|
const renderedGroupNames = useMemo(() => {
|
||||||
if (!proxyView) return []
|
if (!proxyView) return []
|
||||||
if (isChainMode)
|
if (isChainMode)
|
||||||
return selectedGroup ? [selectedGroup] : [CHAIN_DELAY_GROUP]
|
return selectedGroup ? [selectedGroup] : [CHAIN_DELAY_GROUP]
|
||||||
return renderGroups.map(({ name }) => name)
|
return mode === 'rule' || mode === 'global'
|
||||||
}, [isChainMode, proxyView, renderGroups, selectedGroup])
|
? proxyView.groups.map(({ name }) => name)
|
||||||
|
: proxyView.global
|
||||||
|
? [proxyView.global.name]
|
||||||
|
: []
|
||||||
|
}, [isChainMode, mode, proxyView, selectedGroup])
|
||||||
const groupDelays = useGroupsDelays(renderedGroupNames)
|
const groupDelays = useGroupsDelays(renderedGroupNames)
|
||||||
|
|
||||||
const groupCacheRef = useRef<Map<string, GroupCache>>(new Map())
|
const groupCacheRef = useRef<Map<string, GroupCache>>(new Map())
|
||||||
@@ -261,7 +258,13 @@ export const useRenderList = (
|
|||||||
}
|
}
|
||||||
|
|
||||||
const useRule = mode === 'rule' || mode === 'global'
|
const useRule = mode === 'rule' || mode === 'global'
|
||||||
|
const renderGroups = useRule
|
||||||
|
? proxyView.groups
|
||||||
|
: proxyView.global === null
|
||||||
|
? []
|
||||||
|
: [proxyView.global]
|
||||||
const cache = groupCacheRef.current
|
const cache = groupCacheRef.current
|
||||||
|
let anyChanged = false
|
||||||
|
|
||||||
const retList = renderGroups.flatMap((group) => {
|
const retList = renderGroups.flatMap((group) => {
|
||||||
const headState = headStates[group.name] || DEFAULT_STATE
|
const headState = headStates[group.name] || DEFAULT_STATE
|
||||||
@@ -278,6 +281,7 @@ export const useRenderList = (
|
|||||||
return cached.items
|
return cached.items
|
||||||
}
|
}
|
||||||
|
|
||||||
|
anyChanged = true
|
||||||
const ret: IRenderItem[] = [
|
const ret: IRenderItem[] = [
|
||||||
{
|
{
|
||||||
type: 0,
|
type: 0,
|
||||||
@@ -346,10 +350,7 @@ export const useRenderList = (
|
|||||||
const filtered = !useRule
|
const filtered = !useRule
|
||||||
? retList.slice(1)
|
? retList.slice(1)
|
||||||
: retList.filter((item) => !item.group.hidden)
|
: retList.filter((item) => !item.group.hidden)
|
||||||
if (
|
if (!anyChanged && prevListRef.current.length === filtered.length) {
|
||||||
prevListRef.current.length === filtered.length &&
|
|
||||||
filtered.every((item, index) => item === prevListRef.current[index])
|
|
||||||
) {
|
|
||||||
return prevListRef.current
|
return prevListRef.current
|
||||||
}
|
}
|
||||||
prevListRef.current = filtered
|
prevListRef.current = filtered
|
||||||
@@ -363,7 +364,6 @@ export const useRenderList = (
|
|||||||
latencyTimeout,
|
latencyTimeout,
|
||||||
mode,
|
mode,
|
||||||
proxyView,
|
proxyView,
|
||||||
renderGroups,
|
|
||||||
selectedGroup,
|
selectedGroup,
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user