kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Fix logic with toggling Group Tag visibility
rodzic
e5cf1dfa85
commit
4f0cafabcf
|
@ -41,13 +41,16 @@ const GroupTagListItem = (props: IGroupMemberListItem) => {
|
||||||
const isOwner = group.relationship?.role === GroupRoles.OWNER;
|
const isOwner = group.relationship?.role === GroupRoles.OWNER;
|
||||||
|
|
||||||
const toggleVisibility = () => {
|
const toggleVisibility = () => {
|
||||||
|
const isHiding = tag.visible;
|
||||||
|
|
||||||
updateGroupTag({
|
updateGroupTag({
|
||||||
group_tag_type: tag.visible ? 'hidden' : 'normal',
|
group_tag_type: isHiding ? 'hidden' : 'normal',
|
||||||
}, {
|
}, {
|
||||||
onSuccess() {
|
onSuccess() {
|
||||||
const entity = {
|
const entity: GroupTag = {
|
||||||
...tag,
|
...tag,
|
||||||
visible: !tag.visible,
|
visible: !tag.visible,
|
||||||
|
pinned: isHiding ? false : tag.pinned, // unpin if we're hiding
|
||||||
};
|
};
|
||||||
dispatch(importEntities([entity], Entities.GROUP_TAGS));
|
dispatch(importEntities([entity], Entities.GROUP_TAGS));
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue