groups: fix "remove from" / "leave group" text

When you were looking at your own card in another group,
it would say "Remove from" group. This is from an arbitrarily strict
ternary check that adminOpt catches
for us, so we just check if the ship is us.
This commit is contained in:
Matilde Park 2020-03-19 18:16:22 -04:00
parent d1b73f7ae3
commit b2b6c05992

View File

@ -486,9 +486,6 @@ export class ContactCard extends Component {
}
let ourOpt = (props.ship === window.ship) ? "dib" : "dn";
let localOpt =
((props.ship === window.ship) && (props.path === "/~/default"))
? "dib" : "dn";
let adminOpt =
((props.path.includes(`~${window.ship}/`)) || ((props.ship === window.ship) &&
@ -532,7 +529,7 @@ export class ContactCard extends Component {
`bg-gray0-d mv4 mh3 pa1 f9 red2 pointer flex-shrink-0 ` + adminOpt
}
onClick={this.removeFromGroup}>
{props.ship === window.ship && props.path.includes(window.ship)
{props.ship === window.ship
? "Leave Group"
: "Remove from Group"}
</button>