mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add prefer optional chaining rule
This commit is contained in:
parent
ec0adb895b
commit
f35a8151e0
61 changed files with 152 additions and 152 deletions
|
@ -37,7 +37,7 @@ function getDefaultLanguage() {
|
|||
if (navigator.userLanguage) {
|
||||
return navigator.userLanguage;
|
||||
}
|
||||
if (navigator.languages && navigator.languages.length) {
|
||||
if (navigator.languages?.length) {
|
||||
return navigator.languages[0];
|
||||
}
|
||||
|
||||
|
@ -217,12 +217,12 @@ function translateKey(key) {
|
|||
|
||||
function translateKeyFromModule(key, module) {
|
||||
let dictionary = getDictionary(module, getCurrentLocale());
|
||||
if (dictionary && dictionary[key]) {
|
||||
if (dictionary?.[key]) {
|
||||
return dictionary[key];
|
||||
}
|
||||
|
||||
dictionary = getDictionary(module, fallbackCulture);
|
||||
if (dictionary && dictionary[key]) {
|
||||
if (dictionary?.[key]) {
|
||||
return dictionary[key];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue