fix
parent
9eaf072e8f
commit
209bf9e0aa
|
@ -52,10 +52,10 @@ export const getList = async(source: Source): Promise<string[]> => {
|
||||||
task.push(
|
task.push(
|
||||||
sourceList[source]?.length
|
sourceList[source]?.length
|
||||||
? Promise.resolve({ source, list: sourceList[source] })
|
? Promise.resolve({ source, list: sourceList[source] })
|
||||||
: music[source]?.hotSearch.getList().catch((err: any) => {
|
: (music[source]?.hotSearch.getList() ?? Promise.reject(new Error('source not found: ' + source))).catch((err: any) => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
return { source, list: [] }
|
return { source, list: [] }
|
||||||
}) ?? Promise.reject(new Error('source not found: ' + source)),
|
}),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
return Promise.all(task).then((results: any[]) => {
|
return Promise.all(task).then((results: any[]) => {
|
||||||
|
|
Loading…
Reference in New Issue