bigbuffet-rw/app/soapbox/utils/timelines.ts
marcin mikołajczak ae396544a7 Typescript, FC
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-04-11 23:02:37 +02:00

15 lines
495 B
TypeScript

import { Map as ImmutableMap } from 'immutable';
import type { Status as StatusEntity } from 'soapbox/types/entities';
export const shouldFilter = (status: StatusEntity, columnSettings: any) => {
const shows = ImmutableMap({
reblog: status.get('reblog') !== null,
reply: status.get('in_reply_to_id') !== null,
direct: status.get('visibility') === 'direct',
});
return shows.some((value, key) => {
return columnSettings.getIn(['shows', key]) === false && value;
});
};