mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-18 13:44:12 +00:00
refactor: beta 6 (#395)
Few small fixes and refactors from beta 6 feedback * style: presentation tweaks * fix: prevent calling undefined * fix: fullscreen toggle in safari * refactor: convert to typescript and simplify
This commit is contained in:
@@ -30,7 +30,7 @@ export const TranslationProvider = ({ children }: PropsWithChildren) => {
|
||||
const { data } = useSettings();
|
||||
|
||||
const getLocalizedString = useCallback(
|
||||
(key: keyof typeof langEn, lang = data!.language): string => {
|
||||
(key: keyof typeof langEn, lang = data?.language || 'en'): string => {
|
||||
if (lang in translationsList) {
|
||||
if (key in translationsList[lang as keyof typeof translationsList]) {
|
||||
return translationsList[lang as keyof typeof translationsList][key];
|
||||
@@ -38,7 +38,7 @@ export const TranslationProvider = ({ children }: PropsWithChildren) => {
|
||||
}
|
||||
return langEn[key];
|
||||
},
|
||||
[data],
|
||||
[data?.language],
|
||||
);
|
||||
|
||||
const contextValue = {
|
||||
|
||||
Reference in New Issue
Block a user