From 791bc7afbe0efd9519740b999799e6002b0fc835 Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 13 Sep 2024 21:11:17 +0100 Subject: [PATCH] Fix lexicon validation in PWI Discover (#5329) --- src/lib/api/feed/custom.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/api/feed/custom.ts b/src/lib/api/feed/custom.ts index 6db96a8d63..f3ac45b6e3 100644 --- a/src/lib/api/feed/custom.ts +++ b/src/lib/api/feed/custom.ts @@ -2,6 +2,7 @@ import { AppBskyFeedDefs, AppBskyFeedGetFeed as GetCustomFeed, BskyAgent, + jsonStringToLex, } from '@atproto/api' import {getContentLanguages} from '#/state/preferences/languages' @@ -111,7 +112,7 @@ async function loggedOutFetch({ }&limit=${limit}&lang=${contentLangs}`, {method: 'GET', headers: {'Accept-Language': contentLangs}}, ) - let data = res.ok ? await res.json() : null + let data = res.ok ? jsonStringToLex(await res.text()) : null if (data?.feed?.length) { return { success: true, @@ -126,7 +127,7 @@ async function loggedOutFetch({ }&limit=${limit}`, {method: 'GET', headers: {'Accept-Language': ''}}, ) - data = res.ok ? await res.json() : null + data = res.ok ? jsonStringToLex(await res.text()) : null if (data?.feed?.length) { return { success: true,