Refactor CW handling in an action (#31103)
This commit is contained in:
parent
03dea64b79
commit
9cb9427133
5 changed files with 23 additions and 27 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue