From e073acc8cc98f7b096e034d5447df980df45ec99 Mon Sep 17 00:00:00 2001 From: miko Date: Tue, 21 Jan 2025 15:36:12 +0200 Subject: [PATCH] Allow playing videos if api down --- ui/redux/actions/user.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/ui/redux/actions/user.js b/ui/redux/actions/user.js index 9dd60aa576..63fa9224c4 100644 --- a/ui/redux/actions/user.js +++ b/ui/redux/actions/user.js @@ -816,13 +816,11 @@ export function doFetchUserLocale(isRetry = false) { fetch(LOCALE_API) .then((res) => res.json()) .then((json) => { - const locale = json.data; // [flow] local: LocaleInfo - if (locale) { - dispatch({ - type: ACTIONS.USER_FETCH_LOCALE_DONE, - data: locale, - }); - } + const locale = json.data || {}; // [flow] local: LocaleInfo + dispatch({ + type: ACTIONS.USER_FETCH_LOCALE_DONE, + data: locale, + }); }) .catch(() => { if (!isRetry) {