bigbuffet-rw/app/soapbox/utils/timelines.ts
marcin mikołajczak 65dff4e6a1 Reducers: TypeScript
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-06-05 15:05:44 +02:00

15 lines
474 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.reblog !== null,
reply: status.in_reply_to_id !== null,
direct: status.visibility === 'direct',
});
return shows.some((value, key) => {
return columnSettings.getIn(['shows', key]) === false && value;
});
};