Merge branch 'fix-visibility-logic' into 'develop'
Fix logic with toggling Group Tag visibility See merge request soapbox-pub/soapbox!2473
This commit is contained in:
commit
f19e3b01c2
1 changed files with 5 additions and 2 deletions
|
@ -41,13 +41,16 @@ const GroupTagListItem = (props: IGroupMemberListItem) => {
|
|||
const isOwner = group.relationship?.role === GroupRoles.OWNER;
|
||||
|
||||
const toggleVisibility = () => {
|
||||
const isHiding = tag.visible;
|
||||
|
||||
updateGroupTag({
|
||||
group_tag_type: tag.visible ? 'hidden' : 'normal',
|
||||
group_tag_type: isHiding ? 'hidden' : 'normal',
|
||||
}, {
|
||||
onSuccess() {
|
||||
const entity = {
|
||||
const entity: GroupTag = {
|
||||
...tag,
|
||||
visible: !tag.visible,
|
||||
pinned: isHiding ? false : tag.pinned, // unpin if we're hiding
|
||||
};
|
||||
dispatch(importEntities([entity], Entities.GROUP_TAGS));
|
||||
|
||||
|
|
Loading…
Reference in a new issue