feat: Add the judgment of the switch startup for the default downloader

- 增加默认下载器开关启动判断,保证唯一性。
This commit is contained in:
Aqr-K
2024-09-20 18:38:02 +08:00
parent 95d8b3d1a6
commit 6376a81c4a

View File

@@ -91,6 +91,14 @@ function openDownloaderInfoDialog() {
// 保存详情数据
function saveDownloaderInfo() {
// 默认下载器去重
if (downloaderInfo.value.default) {
props.downloaders.forEach(item => {
if (item.default && item !== props.downloader) {
item.default = false
}
})
}
// 为空不保存,跳出警告框
if (!downloaderName.value) {
$toast.error('名称不能为空,请输入后再确定')