fix: try catch errors

This commit is contained in:
Yifei Zhang 2023-03-20 16:29:10 +00:00
parent b4b11a470f
commit ca679e86b4

View File

@ -10,7 +10,7 @@ const LANG_KEY = 'lang'
function getItem(key: string) {
try {
return localStorage.getItem(key)
} finally {
} catch {
return null
}
}
@ -18,13 +18,13 @@ function getItem(key: string) {
function setItem(key: string, value: string) {
try {
localStorage.setItem(key, value)
} finally { }
} catch { }
}
function getLanguage() {
try {
return navigator.language.toLowerCase()
} finally {
} catch {
return 'cn'
}
}