pleroma-fe/src/lib/timeline_visibility.js
Sam Therapy 4535046089
Some checks reported errors
continuous-integration/drone/push Build was killed
Akkoma devs fucking suck
Was this last commit even tested? Apparently. Deployed? No.
Doesn't even work VANILLA, WHY WOULD IT WORK ANYWHERE ELSE???
Thank you for coming to my complaint session.
2023-03-21 15:45:51 +01:00

24 lines
852 B
JavaScript

const timelineVisibleUnauthenticated = (state, timeline) => (
publicTimelineVisible[timeline] ?? false
);
const currentUser = (state) => state.users.currentUser;
const currentUserOrTimelineVisibleUnauthenticated = (state, timeline) => (
currentUser(state) || timelineVisibleUnauthenticated(state, timeline)
);
const federatedTimelineAvailable = (state) => state.instance.federatedTimelineAvailable;
export const federatedTimelineVisible = (state) => (
federatedTimelineAvailable(state) && currentUserOrTimelineVisibleUnauthenticated(state, 'federated')
);
export const publicTimelineVisible = (state) => (
currentUserOrTimelineVisibleUnauthenticated(state, 'local')
);
export const bubbleTimelineVisible = (state) => (
state.instance.localBubbleInstances.length > 0 && currentUserOrTimelineVisibleUnauthenticated(state, 'bubble')
);