mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-05-19 23:29:52 +08:00
feat(settings): AccountSettingService
- 增加防抖。 - `card` 从父组件获取到的值改为深复制,解决 `card` 内修改数据,会直接导致在父组件中同步更新的问题。
This commit is contained in:
@@ -155,15 +155,15 @@ function addDownloader(downloader: string) {
|
||||
}
|
||||
|
||||
// 删除下载器
|
||||
function removeDownloader(ele: DownloaderConf) {
|
||||
const removeDownloader = debounce((ele: DownloaderConf) => {
|
||||
const index = downloaders.value.indexOf(ele)
|
||||
downloaders.value.splice(index, 1)
|
||||
}
|
||||
}, debounceTime)
|
||||
|
||||
// 下载器变化
|
||||
function onDownloaderChange(downloader: DownloaderConf) {
|
||||
const index = downloaders.value.findIndex(item => item.name === downloader.name)
|
||||
downloaders.value[index] = downloader
|
||||
function onDownloaderChange(downloader: DownloaderConf, name: string) {
|
||||
const index = downloaders.value.findIndex(item => item.name === name)
|
||||
if (index !== -1) downloaders.value[index] = downloader
|
||||
}
|
||||
|
||||
// 添加媒体服务器
|
||||
@@ -181,15 +181,15 @@ const addMediaServer = debounce( (mediaserver: string) => {
|
||||
}, debounceTime)
|
||||
|
||||
// 删除媒体服务器
|
||||
function removeMediaServer(ele: MediaServerConf) {
|
||||
const removeMediaServer = debounce((ele: MediaServerConf) => {
|
||||
const index = mediaServers.value.indexOf(ele)
|
||||
mediaServers.value.splice(index, 1)
|
||||
}
|
||||
if (index !== -1) mediaServers.value.splice(index, 1)
|
||||
}, debounceTime)
|
||||
|
||||
// 变更媒体服务器
|
||||
function onMediaServerChange(mediaserver: MediaServerConf) {
|
||||
const index = mediaServers.value.findIndex(item => item.name === mediaserver.name)
|
||||
mediaServers.value[index] = mediaserver
|
||||
function onMediaServerChange(mediaserver: MediaServerConf, name: string) {
|
||||
const index = mediaServers.value.findIndex(item => item.name === name)
|
||||
if (index !== -1) mediaServers.value[index] = mediaserver
|
||||
}
|
||||
|
||||
// 禁止保存
|
||||
|
||||
Reference in New Issue
Block a user