on master help sign in
Require point to be active where appropriate
commit7fda5008b0fb3b07d3c6d22cada5c0421f1d3867 authorFang <git@fang.io> dateFri 12 Jul 2019, 18:19 (7 years ago) parent8130b60
2 files changed+5−3
src/lib/usePermissionsForPoint.js+2 src/views/Point.js+3−3
src/lib/usePermissionsForPoint.js+2
@@ -30,6 +30,7 @@ export default function usePermissionsForPoint(address, point) {
3030 const isGalaxy = pointSize === azimuth.PointSize.Galaxy;
3131
3232 const isOwner = eqAddr(address, details.owner);
33+ const isActiveOwner = isOwner && details.active;
3334 const isTransferProxy = eqAddr(address, details.transferProxy);
3435 const isManagementProxy = eqAddr(address, details.managementProxy);
3536 const isSpawnProxy = eqAddr(address, details.spawnProxy);
@@ -43,6 +44,7 @@ export default function usePermissionsForPoint(address, point) {
4344
4445 return {
4546 isOwner,
47+ isActiveOwner,
4648 isTransferProxy,
4749 isManagementProxy,
4850 canManage,
src/views/Point.js+3−3
@@ -31,7 +31,7 @@ export default function Point() {
3131
3232 const point = need.point(pointCursor);
3333
34− const { isOwner, canManage } = usePermissionsForPoint(
34+ const { isActiveOwner, canManage } = usePermissionsForPoint(
3535 // using empty string should be ok here
3636 wallet.matchWith({
3737 Nothing: () => '',
@@ -59,14 +59,14 @@ export default function Point() {
5959 case azimuth.PointSize.Planet:
6060 const availableInvitesText = matchBlinky(availableInvites);
6161 return (
62− <FooterButton disabled={!isOwner} onClick={goInvite}>
62+ <FooterButton disabled={!isActiveOwner} onClick={goInvite}>
6363 Invite <sup>{availableInvitesText} available</sup>
6464 </FooterButton>
6565 );
6666 //
6767 case azimuth.PointSize.Star:
6868 return (
69− <FooterButton disabled={!isOwner} onClick={goParties}>
69+ <FooterButton disabled={!isActiveOwner} onClick={goParties}>
7070 Manage parties
7171 </FooterButton>
7272 );