Refactor CW handling in an action (#31103)

This commit is contained in:
Claire 2024-07-22 18:03:58 +02:00 committed by GitHub
parent 03dea64b79
commit 9cb9427133
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 23 additions and 27 deletions

View file

@ -308,6 +308,21 @@ export function revealStatus(ids) {
};
}
export function toggleStatusSpoilers(statusId) {
return (dispatch, getState) => {
const status = getState().statuses.get(statusId);
if (!status)
return;
if (status.get('hidden')) {
dispatch(revealStatus(statusId));
} else {
dispatch(hideStatus(statusId));
}
};
}
export function toggleStatusCollapse(id, isCollapsed) {
return {
type: STATUS_COLLAPSE,