From d7337d8fed7bcef2ffd33fbcbd6a2194348ab293 Mon Sep 17 00:00:00 2001 From: miko <34790748+keikari@users.noreply.github.com> Date: Tue, 21 Jan 2025 18:34:01 +0200 Subject: [PATCH] Actually allow playing videos if api down (#3212) Co-authored-by: miko --- ui/redux/actions/user.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/redux/actions/user.js b/ui/redux/actions/user.js index 63fa9224c..8ee087a68 100644 --- a/ui/redux/actions/user.js +++ b/ui/redux/actions/user.js @@ -814,8 +814,11 @@ export function doCheckYoutubeTransfer() { export function doFetchUserLocale(isRetry = false) { return (dispatch) => { fetch(LOCALE_API) - .then((res) => res.json()) - .then((json) => { + .then(async (res) => { + let json = {}; + try { + json = await res.json(); + } catch (e) {} const locale = json.data || {}; // [flow] local: LocaleInfo dispatch({ type: ACTIONS.USER_FETCH_LOCALE_DONE,