on master help sign in
Require point to be active where appropriate
7fda500Fang
src/lib/usePermissionsForPoint.js+2
@@ -30,6 +30,7 @@ export default function usePermissionsForPoint(address, point) {
30 const isGalaxy = pointSize === azimuth.PointSize.Galaxy;
30 const isGalaxy = pointSize === azimuth.PointSize.Galaxy;
31
31
32 const isOwner = eqAddr(address, details.owner);
32 const isOwner = eqAddr(address, details.owner);
33+ const isActiveOwner = isOwner && details.active;
33 const isTransferProxy = eqAddr(address, details.transferProxy);
34 const isTransferProxy = eqAddr(address, details.transferProxy);
34 const isManagementProxy = eqAddr(address, details.managementProxy);
35 const isManagementProxy = eqAddr(address, details.managementProxy);
35 const isSpawnProxy = eqAddr(address, details.spawnProxy);
36 const isSpawnProxy = eqAddr(address, details.spawnProxy);
@@ -43,6 +44,7 @@ export default function usePermissionsForPoint(address, point) {
43
44
44 return {
45 return {
45 isOwner,
46 isOwner,
47+ isActiveOwner,
46 isTransferProxy,
48 isTransferProxy,
47 isManagementProxy,
49 isManagementProxy,
48 canManage,
50 canManage,
src/views/Point.js+3−3
@@ -31,7 +31,7 @@ export default function Point() {
31
31
32 const point = need.point(pointCursor);
32 const point = need.point(pointCursor);
33
33
34− const { isOwner, canManage } = usePermissionsForPoint(
34+ const { isActiveOwner, canManage } = usePermissionsForPoint(
35 // using empty string should be ok here
35 // using empty string should be ok here
36 wallet.matchWith({
36 wallet.matchWith({
37 Nothing: () => '',
37 Nothing: () => '',
@@ -59,14 +59,14 @@ export default function Point() {
59 case azimuth.PointSize.Planet:
59 case azimuth.PointSize.Planet:
60 const availableInvitesText = matchBlinky(availableInvites);
60 const availableInvitesText = matchBlinky(availableInvites);
61 return (
61 return (
62− <FooterButton disabled={!isOwner} onClick={goInvite}>
62+ <FooterButton disabled={!isActiveOwner} onClick={goInvite}>
63 Invite <sup>{availableInvitesText} available</sup>
63 Invite <sup>{availableInvitesText} available</sup>
64 </FooterButton>
64 </FooterButton>
65 );
65 );
66 //
66 //
67 case azimuth.PointSize.Star:
67 case azimuth.PointSize.Star:
68 return (
68 return (
69− <FooterButton disabled={!isOwner} onClick={goParties}>
69+ <FooterButton disabled={!isActiveOwner} onClick={goParties}>
70 Manage parties
70 Manage parties
71 </FooterButton>
71 </FooterButton>
72 );
72 );