Update selectPeers.vue

This commit is contained in:
Donald Zou 2024-10-14 17:27:34 +08:00
parent 563268558b
commit bb700f3a3d

View File

@ -71,14 +71,11 @@ const el = useTemplateRef("sp")
console.log(el.value) console.log(el.value)
const submitDownload = async () => { const submitDownload = async () => {
downloadConfirmation.value = true downloadConfirmation.value = true
// await sleep(100)
for (const x of selectedPeers.value) { for (const x of selectedPeers.value) {
// await sleep(100)
cardBody.value.scrollTo({ cardBody.value.scrollTo({
top: el.value.find(y => y.dataset.id === x).offsetTop - 20, top: el.value.find(y => y.dataset.id === x).offsetTop - 20,
behavior: 'smooth' behavior: 'smooth'
}) })
await fetchGet("/api/downloadPeer/"+route.params.id, { await fetchGet("/api/downloadPeer/"+route.params.id, {
id: x id: x
}, (res) => { }, (res) => {
@ -95,7 +92,6 @@ const submitDownload = async () => {
downloaded.failed.push(x) downloaded.failed.push(x)
} }
}) })
} }
} }
const clearDownload = () => { const clearDownload = () => {