···2222import showToast from '../utils/show-toast';
2323import states, { saveStatus } from '../utils/states';
2424import { isMediaFirstInstance } from '../utils/store-utils';
2525+import supports from '../utils/supports';
2526import useTitle from '../utils/useTitle';
26272728const LIMIT = 20;
···198199 }
199200 const { value, done } = await accountStatusesIterator.current.next();
200201 if (value?.length) {
201201- // Check if value is same as pinned post (results)
202202- // If the index for every post is the same, means API might not support pinned posts
203203- if (results.length) {
204204- let pinnedStatusesIds = [];
205205- if (results[0]?.type === 'pinned') {
206206- pinnedStatusesIds = results[0].id;
207207- } else {
208208- pinnedStatusesIds = results
209209- .filter((status) => status._pinned)
210210- .map((status) => status.id);
211211- }
212212- const containsAllPinned = pinnedStatusesIds.every((postId) =>
213213- value.some((status) => status.id === postId),
214214- );
215215- if (containsAllPinned) {
216216- // Remove pinned posts
217217- results = [];
202202+ if (!supports('@mastodon/pinned-posts')) {
203203+ // Check if value is same as pinned post (results)
204204+ // If the index for every post is the same, means API might not support pinned posts
205205+ // TODO: This is a really weird check, fix this at some point
206206+ if (results.length) {
207207+ let pinnedStatusesIds = [];
208208+ if (results[0]?.type === 'pinned') {
209209+ pinnedStatusesIds = results[0].id;
210210+ } else {
211211+ pinnedStatusesIds = results
212212+ .filter((status) => status._pinned)
213213+ .map((status) => status.id);
214214+ }
215215+ const containsAllPinned = pinnedStatusesIds.every((postId) =>
216216+ value.some((status) => status.id === postId),
217217+ );
218218+ if (containsAllPinned) {
219219+ // Remove pinned posts
220220+ results = [];
221221+ }
218222 }
219223 }
220224