Fix lexicon validation in PWI Discover (#5329)
parent
26508cfe6a
commit
791bc7afbe
|
@ -2,6 +2,7 @@ import {
|
||||||
AppBskyFeedDefs,
|
AppBskyFeedDefs,
|
||||||
AppBskyFeedGetFeed as GetCustomFeed,
|
AppBskyFeedGetFeed as GetCustomFeed,
|
||||||
BskyAgent,
|
BskyAgent,
|
||||||
|
jsonStringToLex,
|
||||||
} from '@atproto/api'
|
} from '@atproto/api'
|
||||||
|
|
||||||
import {getContentLanguages} from '#/state/preferences/languages'
|
import {getContentLanguages} from '#/state/preferences/languages'
|
||||||
|
@ -111,7 +112,7 @@ async function loggedOutFetch({
|
||||||
}&limit=${limit}&lang=${contentLangs}`,
|
}&limit=${limit}&lang=${contentLangs}`,
|
||||||
{method: 'GET', headers: {'Accept-Language': 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) {
|
if (data?.feed?.length) {
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
|
@ -126,7 +127,7 @@ async function loggedOutFetch({
|
||||||
}&limit=${limit}`,
|
}&limit=${limit}`,
|
||||||
{method: 'GET', headers: {'Accept-Language': ''}},
|
{method: 'GET', headers: {'Accept-Language': ''}},
|
||||||
)
|
)
|
||||||
data = res.ok ? await res.json() : null
|
data = res.ok ? jsonStringToLex(await res.text()) : null
|
||||||
if (data?.feed?.length) {
|
if (data?.feed?.length) {
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
|
|
Loading…
Reference in New Issue