mirror of
				https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
				synced 2025-11-04 16:23:41 +08:00 
			
		
		
		
	fix: try catch errors
This commit is contained in:
		@@ -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'
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user