diff --git a/src/lang/en-us.json b/src/lang/en-us.json index d45c1f83..32af9b11 100644 --- a/src/lang/en-us.json +++ b/src/lang/en-us.json @@ -140,6 +140,7 @@ "my_list": "Your Library", "no_item": "Nothing's here...", "not_agree": "Not accept", + "ok": "Ok", "pagination__next": "Next page", "pagination__page": "Page {num}", "pagination__prev": "Previous page", diff --git a/src/lang/zh-cn.json b/src/lang/zh-cn.json index 1599efa0..4bd878a7 100644 --- a/src/lang/zh-cn.json +++ b/src/lang/zh-cn.json @@ -140,6 +140,7 @@ "my_list": "我的列表", "no_item": "列表竟然是空的...", "not_agree": "不接受", + "ok": "好吧", "pagination__next": "下一页", "pagination__page": "第 {num} 页", "pagination__prev": "上一页", diff --git a/src/lang/zh-tw.json b/src/lang/zh-tw.json index 68e16f3c..93769b46 100644 --- a/src/lang/zh-tw.json +++ b/src/lang/zh-tw.json @@ -140,6 +140,7 @@ "my_list": "我的列表", "no_item": "列表竟然是空的...", "not_agree": "不接受", + "ok": "好吧", "pagination__next": "下一頁", "pagination__page": "第 {num} 頁", "pagination__prev": "上一頁", diff --git a/src/renderer/core/useApp/useDeepLink.js b/src/renderer/core/useApp/useDeepLink.js index 1d253da1..1a1dea8e 100644 --- a/src/renderer/core/useApp/useDeepLink.js +++ b/src/renderer/core/useApp/useDeepLink.js @@ -7,6 +7,18 @@ import { isShowPlayerDetail, setShowPlayerDetail, playMusicInfo } from '@rendere import usePlaySonglist from './compositions/usePlaySonglist' import { dialog } from '@renderer/plugins/Dialog' +const useDialog = () => { + const { t } = useI18n() + const errorDialog = message => { + dialog({ + message: `${t('deep_link__handle_error_tip', { message })}`, + confirmButtonText: t('ok'), + }) + } + + return errorDialog +} + const sources = ['kw', 'kg', 'tx', 'wy', 'mg'] const sourceVerify = source => { if (!sources.includes(source)) throw new Error('Source no match') @@ -58,9 +70,10 @@ export default () => { const setTempPlayList = useCommit('player', 'setTempPlayList') const playNext = useAction('player', 'playNext') const playSongListDetail = usePlaySonglist() - const { t } = useI18n() let isInited = false + const showErrorDialog = useDialog() + const handleOpenSonglist = params => { if (params.id) { router.replace({ @@ -243,7 +256,7 @@ export default () => { try { handleLinkAction(envParams.deeplink) } catch (err) { - dialog(`${t('deep_link__handle_error_tip', { message: err.message })}`) + showErrorDialog(err.message) } }) } @@ -260,7 +273,7 @@ export default () => { try { handleLinkAction(envParams.deeplink) } catch (err) { - dialog(`${t('deep_link__handle_error_tip', { message: err.message })}`) + showErrorDialog(err.message) } } isInited = true