this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix pinned posts not appearing

+22 -17
+21 -17
src/pages/account-statuses.jsx
··· 22 22 import showToast from '../utils/show-toast'; 23 23 import states, { saveStatus } from '../utils/states'; 24 24 import { isMediaFirstInstance } from '../utils/store-utils'; 25 + import supports from '../utils/supports'; 25 26 import useTitle from '../utils/useTitle'; 26 27 27 28 const LIMIT = 20; ··· 198 199 } 199 200 const { value, done } = await accountStatusesIterator.current.next(); 200 201 if (value?.length) { 201 - // Check if value is same as pinned post (results) 202 - // If the index for every post is the same, means API might not support pinned posts 203 - if (results.length) { 204 - let pinnedStatusesIds = []; 205 - if (results[0]?.type === 'pinned') { 206 - pinnedStatusesIds = results[0].id; 207 - } else { 208 - pinnedStatusesIds = results 209 - .filter((status) => status._pinned) 210 - .map((status) => status.id); 211 - } 212 - const containsAllPinned = pinnedStatusesIds.every((postId) => 213 - value.some((status) => status.id === postId), 214 - ); 215 - if (containsAllPinned) { 216 - // Remove pinned posts 217 - results = []; 202 + if (!supports('@mastodon/pinned-posts')) { 203 + // Check if value is same as pinned post (results) 204 + // If the index for every post is the same, means API might not support pinned posts 205 + // TODO: This is a really weird check, fix this at some point 206 + if (results.length) { 207 + let pinnedStatusesIds = []; 208 + if (results[0]?.type === 'pinned') { 209 + pinnedStatusesIds = results[0].id; 210 + } else { 211 + pinnedStatusesIds = results 212 + .filter((status) => status._pinned) 213 + .map((status) => status.id); 214 + } 215 + const containsAllPinned = pinnedStatusesIds.every((postId) => 216 + value.some((status) => status.id === postId), 217 + ); 218 + if (containsAllPinned) { 219 + // Remove pinned posts 220 + results = []; 221 + } 218 222 } 219 223 } 220 224
+1
src/utils/supports.js
··· 20 20 '@mastodon/post-edit': notContainPixelfed, 21 21 '@mastodon/profile-edit': notContainPixelfed, 22 22 '@mastodon/profile-private-note': notContainPixelfed, 23 + '@mastodon/pinned-posts': notContainPixelfed, 23 24 '@pixelfed/trending': containPixelfed, 24 25 '@pixelfed/home-include-reblogs': containPixelfed, 25 26 '@pixelfed/global-feed': containPixelfed,