mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-10-14 21:20:48 +08:00
fix(tests): reset test item state when delay test fails (#8231)
* fix(tests): reset test item state when delay test fails * docs(changelog): note test-item stuck-state fix Co-authored-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> Signed-off-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> --------- Signed-off-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> Co-authored-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
<summary><strong> 🐞 修复问题 </strong></summary>
|
||||
|
||||
- 修复通过 URL 导入订阅时,即使导入的订阅并非当前使用的订阅,也会重新加载当前配置的问题
|
||||
- 修复「首页」网站测速失败后卡片一直显示测试中的问题
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { LanguageRounded } from '@mui/icons-material'
|
||||
import { Box, Divider, MenuItem, Menu, styled, alpha } from '@mui/material'
|
||||
import { alpha, Box, Divider, Menu, MenuItem, styled } from '@mui/material'
|
||||
import { useLockFn } from 'ahooks'
|
||||
import { useCallback, useEffect, useRef, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
@@ -29,8 +29,14 @@ export const TestItem = ({ itemData, onEdit, onDelete: removeTest }: Props) => {
|
||||
|
||||
const onDelay = useCallback(async () => {
|
||||
setDelay(-2)
|
||||
const result = await cmdTestDelay(url!)
|
||||
setDelay(result)
|
||||
try {
|
||||
const result = await cmdTestDelay(url!)
|
||||
setDelay(result)
|
||||
} catch (err) {
|
||||
// A failed test must not leave the item stuck in the loading state.
|
||||
setDelay(-1)
|
||||
showNotice.error(err)
|
||||
}
|
||||
}, [url])
|
||||
|
||||
const onEditTest = () => {
|
||||
|
||||
Reference in New Issue
Block a user