fix detectLanguage

This commit is contained in:
Gabe Yuan
2023-08-28 11:14:03 +08:00
parent 620ac464eb
commit f9bfa8101f

View File

@@ -100,7 +100,7 @@ export const matchRule = async (
*/
export const detectLang = async (q) => {
try {
const res = await browser?.i18n.detectLanguage(q);
const res = await browser?.i18n?.detectLanguage(q);
return res?.languages?.[0]?.language;
} catch (err) {
console.log("[detect lang]", err);