修复从Scheme URL启动软件打开歌单详情时会加载两次的问题

pull/930/merge
lyswhut 2022-01-11 15:25:35 +08:00
parent 4d31bde98a
commit ca748906c0
1 changed files with 11 additions and 6 deletions

View File

@ -57,6 +57,7 @@ export default () => {
const playNext = useAction('player', 'playNext')
const playSongListDetail = usePlaySonglist()
const { t } = useI18n()
let isInited = false
const handleOpenSonglist = params => {
if (params.id) {
@ -232,6 +233,8 @@ export default () => {
}
const handleFocus = () => {
if (!isInited) return
getEnvParams().then(envParams => {
if (!envParams.deeplink) return
clearEnvParamsDeeplink()
@ -250,12 +253,14 @@ export default () => {
})
return envParams => {
if (!envParams.deeplink) return
clearEnvParamsDeeplink()
try {
handleLinkAction(envParams.deeplink)
} catch (err) {
dialog(`${t('deep_link__handle_error_tip', { message: err.message })}`)
if (envParams.deeplink) {
clearEnvParamsDeeplink()
try {
handleLinkAction(envParams.deeplink)
} catch (err) {
dialog(`${t('deep_link__handle_error_tip', { message: err.message })}`)
}
}
isInited = true
}
}