From 6d8c483aa43f9e61422eb2aeb3bdcfecd083d7ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Wed, 6 Aug 2025 23:59:44 +0200 Subject: [PATCH] pl-fe: kurwa MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk --- packages/pl-fe/src/reducers/auth.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/pl-fe/src/reducers/auth.ts b/packages/pl-fe/src/reducers/auth.ts index abb748485..761bb8144 100644 --- a/packages/pl-fe/src/reducers/auth.ts +++ b/packages/pl-fe/src/reducers/auth.ts @@ -24,9 +24,15 @@ import { ME_FETCH_SKIP, type MeAction } from '../actions/me'; import type { PlfeResponse } from 'pl-fe/api'; import type { Account as AccountEntity } from 'pl-fe/normalizers/account'; -const preloadedInstance = decodeFromMarkup('initial-results', pleromaDecoder)['/api/v1/instance']; -const parsedInstance = v.safeParse(instanceSchema, preloadedInstance); -const instance = parsedInstance.success ? parsedInstance.output : undefined; +const instance = (() => { + try { + const preloadedInstance = decodeFromMarkup('initial-results', pleromaDecoder)['/api/v1/instance']; + const parsedInstance = v.safeParse(instanceSchema, preloadedInstance); + return parsedInstance.success ? parsedInstance.output : undefined; + } catch (e) { + return undefined; + } +})(); type Action = AuthAction | MeAction | PreloadAction;