this repo has no description
0
fork

Configure Feed

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

Preliminary filter work on notifications

+11
+11
src/components/notification.jsx
··· 4 4 import { memo } from 'preact/compat'; 5 5 6 6 import { api } from '../utils/api'; 7 + import { isFiltered } from '../utils/filters'; 7 8 import shortenNumber from '../utils/shorten-number'; 8 9 import states, { statusKey } from '../utils/states'; 9 10 import { getCurrentAccountID } from '../utils/store-utils'; ··· 450 451 const diffCount = 451 452 notificationsCount > 0 && notificationsCount > sampleAccounts?.length; 452 453 const expandAccounts = diffCount ? 'remote' : 'local'; 454 + 455 + // If there's a status and filter action is 'hide', then the notification is hidden 456 + // TODO: Handle 'warn' action one day 457 + if (!!status?.filtered) { 458 + const isOwnPost = status?.account?.id === currentAccount; 459 + const filterInfo = isFiltered(status.filtered, 'notifications'); 460 + if (!isSelf && !isOwnPost && filterInfo?.action === 'hide') { 461 + return null; 462 + } 463 + } 453 464 454 465 return ( 455 466 <div