diff --git a/src/pages/public.jsx b/src/pages/public.jsx index 7b90f37f..c1d49216 100644 --- a/src/pages/public.jsx +++ b/src/pages/public.jsx @@ -10,6 +10,7 @@ import { api } from '../utils/api'; import { filteredItems } from '../utils/filters'; import states from '../utils/states'; import { saveStatus } from '../utils/states'; +import supports from '../utils/supports'; import useTitle from '../utils/useTitle'; const LIMIT = 20; @@ -30,11 +31,14 @@ function Public({ local, columnMode, ...props }) { const publicIterator = useRef(); async function fetchPublic(firstLoad) { if (firstLoad || !publicIterator.current) { - publicIterator.current = masto.v1.timelines.public.list({ + const opts = { limit: LIMIT, - local: isLocal, - remote: !isLocal, // Pixelfed - }); + local: isLocal || undefined, + }; + if (!isLocal && supports('@pixelfed/global-feed')) { + opts.remote = true; + } + publicIterator.current = masto.v1.timelines.public.list(opts); } const results = await publicIterator.current.next(); let { value } = results; diff --git a/src/utils/supports.js b/src/utils/supports.js index 95d613c1..adfd1e35 100644 --- a/src/utils/supports.js +++ b/src/utils/supports.js @@ -19,6 +19,7 @@ const platformFeatures = { '@mastodon/profile-private-note': notContainPixelfed, '@pixelfed/trending': containPixelfed, '@pixelfed/home-include-reblogs': containPixelfed, + '@pixelfed/global-feed': containPixelfed, }; const supportsCache = {};