on master help sign in
fix: correctly include ecliptic owner logic
commitb2862a8f46b34162dd0f64af0f003e20c15d501b authorMatt Condon (shrugs) <mattgcondon@gmail.com> dateFri 28 Jun 2019, 16:51 (7 years ago) parent01c95c6
2 files changed+9−1
src/lib/useIsEclipticOwner.js+6−1 src/store/lib/usePointStore.js+3
src/lib/useIsEclipticOwner.js+6−1
@@ -2,10 +2,15 @@ import { useWallet } from 'store/wallet';
22import { usePointCache } from 'store/pointCache';
33
44import { eqAddr } from 'lib/wallet';
5+import useLifecycle from './useLifecycle';
56
67export default function useIsEclipticOwner() {
78 const { wallet } = useWallet();
8− const { eclipticOwner } = usePointCache();
9+ const { eclipticOwner, syncEclipticOwner } = usePointCache();
10+
11+ useLifecycle(() => {
12+ syncEclipticOwner();
13+ });
914
1015 return wallet.matchWith({
1116 Nothing: () => false,
src/store/lib/usePointStore.js+3
@@ -4,11 +4,13 @@ import useDetailsStore from './useDetailsStore';
44import useBirthdaysStore from './useBirthdaysStore';
55import useInvitesStore from './useInvitesStore';
66import useControlledPointsStore from './useControlledPointsStore';
7+import useEclipticOwnerStore from './useEclipticOwnerStore';
78
89export default function usePointStore() {
910 const { syncDetails, ...details } = useDetailsStore();
1011 const { syncBirthday, ...birthdays } = useBirthdaysStore();
1112 const { syncInvites, ...invites } = useInvitesStore();
13+ const ecliptic = useEclipticOwnerStore();
1214 const {
1315 syncControlledPoints,
1416 ...controlledPoints
@@ -33,6 +35,7 @@ export default function usePointStore() {
3335 ...birthdays,
3436 ...invites,
3537 ...controlledPoints,
38+ ...ecliptic,
3639 syncInvites,
3740 syncControlledPoints,
3841 syncOwnedPoint,