修复换源失败时的处理问题

This commit is contained in:
lyswhut
2022-04-05 22:08:35 +08:00
parent 93f3507dc8
commit 3c970c24c1
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -31,8 +31,9 @@ const actions = {
if (getOtherSourcePromises.has(key)) return getOtherSourcePromises.get(key)
const promise = musicSdk.findMusic(musicInfo).then(otherSource => {
commit('setOtherSource', { musicInfo, otherSource })
if (getOtherSourcePromises.has(key)) getOtherSourcePromises.delete(key)
return otherSource
}).finally(() => {
if (getOtherSourcePromises.has(key)) getOtherSourcePromises.delete(key)
})
getOtherSourcePromises.set(key, promise)
return promise