修复程序初始化顺序导致的问题
parent
2aa4ff8422
commit
2d5e336f0f
|
@ -5,13 +5,13 @@ import musicSdk from '@renderer/utils/musicSdk'
|
||||||
import apiSourceInfo from '@renderer/utils/musicSdk/api-source-info'
|
import apiSourceInfo from '@renderer/utils/musicSdk/api-source-info'
|
||||||
|
|
||||||
|
|
||||||
export const setUserApi = (apiId: string) => {
|
export const setUserApi = async(apiId: string) => {
|
||||||
if (/^user_api/.test(apiId)) {
|
if (/^user_api/.test(apiId)) {
|
||||||
qualityList.value = {}
|
qualityList.value = {}
|
||||||
userApi.status = false
|
userApi.status = false
|
||||||
userApi.message = 'initing'
|
userApi.message = 'initing'
|
||||||
|
|
||||||
setUserApiAction(apiId).then(() => {
|
await setUserApiAction(apiId).then(() => {
|
||||||
apiSource.value = apiId
|
apiSource.value = apiId
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err)
|
console.log(err)
|
||||||
|
|
|
@ -14,7 +14,7 @@ const initPrevPlayInfo = async() => {
|
||||||
window.lx.restorePlayInfo = null
|
window.lx.restorePlayInfo = null
|
||||||
if (!info?.listId || info.index < 0) return
|
if (!info?.listId || info.index < 0) return
|
||||||
const list = await getListMusics(info.listId)
|
const list = await getListMusics(info.listId)
|
||||||
if (!list || !list[info.index]) return
|
if (!list?.[info.index]) return
|
||||||
window.lx.restorePlayInfo = info
|
window.lx.restorePlayInfo = info
|
||||||
playList(info.listId, info.index)
|
playList(info.listId, info.index)
|
||||||
|
|
||||||
|
|
|
@ -95,8 +95,8 @@ export default () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
return async() => {
|
return async() => {
|
||||||
void setUserApi(appSetting['common.apiSource'])
|
await setUserApi(appSetting['common.apiSource'])
|
||||||
return await getUserApiList().then(list => {
|
void getUserApiList().then(list => {
|
||||||
// console.log(list)
|
// console.log(list)
|
||||||
// if (![...apiSourceInfo.map(s => s.id), ...list.map(s => s.id)].includes(appSetting['common.apiSource'])) {
|
// if (![...apiSourceInfo.map(s => s.id), ...list.map(s => s.id)].includes(appSetting['common.apiSource'])) {
|
||||||
// console.warn('reset api')
|
// console.warn('reset api')
|
||||||
|
|
|
@ -23,7 +23,7 @@ export default () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(() => appSetting['common.apiSource'], apiSource => {
|
watch(() => appSetting['common.apiSource'], apiSource => {
|
||||||
setUserApi(apiSource)
|
void setUserApi(apiSource)
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(() => appSetting['common.font'], (val) => {
|
watch(() => appSetting['common.font'], (val) => {
|
||||||
|
|
Loading…
Reference in New Issue