pl-api: optimization

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2026-03-18 16:25:02 +01:00
parent 8ee0abc86d
commit 1cbdb1ab36

View File

@ -50,12 +50,8 @@ const baseStatusSchema = v.object({
account: v.pipe(
v.unknown(),
v.transform((account) => {
if (
typeof window !== 'undefined' &&
(window as any).__PL_API_FALLBACK_ACCOUNT &&
JSON.stringify(account) === '{}'
)
return (window as any).__PL_API_FALLBACK_ACCOUNT;
const fallbackAccount = (window as any)?.__PL_API_FALLBACK_ACCOUNT;
if (fallbackAccount && Object.keys(account as object).length > 0) return fallbackAccount;
return account;
}),
accountSchema,