this repo has no description
0
fork

Configure Feed

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

Fix hide-filtered items appearing in boost carousel

+10 -9
+10 -9
src/components/timeline.jsx
··· 5 5 import { useSnapshot } from 'valtio'; 6 6 7 7 import FilterContext from '../utils/filter-context'; 8 - import { isFiltered } from '../utils/filters'; 8 + import { filteredItems, isFiltered } from '../utils/filters'; 9 9 import states, { statusKey } from '../utils/states'; 10 10 import statusPeek from '../utils/status-peek'; 11 11 import { groupBoosts, groupContext } from '../utils/timeline-utils'; ··· 496 496 } 497 497 const isCarousel = type === 'boosts' || type === 'pinned'; 498 498 if (items) { 499 + const fItems = filteredItems(items, filterContext); 499 500 if (isCarousel) { 500 501 // Here, we don't hide filtered posts, but we sort them last 501 - items.sort((a, b) => { 502 + fItems.sort((a, b) => { 502 503 // if (a._filtered && !b._filtered) { 503 504 // return 1; 504 505 // } ··· 518 519 return ( 519 520 <li key={`timeline-${statusID}`} class="timeline-item-carousel"> 520 521 <StatusCarousel title={title} class={`${type}-carousel`}> 521 - {items.map((item) => { 522 + {fItems.map((item) => { 522 523 const { id: statusID, reblog, _pinned } = item; 523 524 const actualStatusID = reblog?.id || statusID; 524 525 const url = instance ··· 555 556 </li> 556 557 ); 557 558 } 558 - const manyItems = items.length > 3; 559 - return items.map((item, i) => { 559 + const manyItems = fItems.length > 3; 560 + return fItems.map((item, i) => { 560 561 const { id: statusID, _differentAuthor } = item; 561 562 const url = instance ? `/${instance}/s/${statusID}` : `/s/${statusID}`; 562 - const isMiddle = i > 0 && i < items.length - 1; 563 + const isMiddle = i > 0 && i < fItems.length - 1; 563 564 const isSpoiler = item.sensitive && !!item.spoilerText; 564 565 const showCompact = 565 566 (!_differentAuthor && isSpoiler && i > 0) || ··· 568 569 (type === 'thread' || 569 570 (type === 'conversation' && 570 571 !_differentAuthor && 571 - !items[i - 1]._differentAuthor && 572 - !items[i + 1]._differentAuthor))); 572 + !fItems[i - 1]._differentAuthor && 573 + !fItems[i + 1]._differentAuthor))); 573 574 const isStart = i === 0; 574 - const isEnd = i === items.length - 1; 575 + const isEnd = i === fItems.length - 1; 575 576 return ( 576 577 <li 577 578 key={`timeline-${statusID}`}