on master help sign in
fix: update getDetails to correctly return Maybe and allow Actions to exist on Point.js
2af5239Matt Condon (shrugs)
src/store/lib/useDetailsStore.js+3−1
@@ -18,8 +18,10 @@ export default function useDetailsStore() {
18 );
18 );
19
19
20 // TODO: refactor detailsCache access to use accessor like bithday
20 // TODO: refactor detailsCache access to use accessor like bithday
21+ // Maybe<{}>
21 const getDetails = useCallback(
22 const getDetails = useCallback(
23+ point =>
22− point => detailsCache[point] || Maybe.Nothing(),
24+ point in detailsCache ? Maybe.Just(detailsCache[point]) : Maybe.Nothing(),
23 [detailsCache]
25 [detailsCache]
24 );
26 );
25
27
src/views/Point.js+2−2
@@ -48,9 +48,9 @@ export default function Point() {
48 Boot Arvo
48 Boot Arvo
49 </ForwardButton>
49 </ForwardButton>
50 </Grid.Item>
50 </Grid.Item>
51− {/* <Grid.Item full>
51+ <Grid.Item full>
52 <Actions />
52 <Actions />
53− </Grid.Item> */}
53+ </Grid.Item>
54 </Grid>
54 </Grid>
55
55
56 <FooterButton onClick={goInvite}>
56 <FooterButton onClick={goInvite}>
src/views/Point/Actions.js+2−5
@@ -1,5 +1,4 @@
1import React from 'react';
1import React from 'react';
2−import Maybe from 'folktale/maybe';
3import { azimuth } from 'azimuth-js';
2import { azimuth } from 'azimuth-js';
4import * as need from '../../lib/need';
3import * as need from '../../lib/need';
5
4
@@ -21,10 +20,8 @@ function Actions(props) {
21 const { wallet } = useWallet();
20 const { wallet } = useWallet();
22 const { pointCursor } = usePointCursor();
21 const { pointCursor } = usePointCursor();
23 const point = need.pointCursor(pointCursor);
22 const point = need.pointCursor(pointCursor);
24− const { pointCache } = usePointCache();
23+ const { getDetails } = usePointCache();
25− const pointDetails = Maybe.Just(
24+ const pointDetails = getDetails(point);
26− need.fromPointCache(Maybe.Just(pointCache), point)
27− );
28
25
29 const addr = need.addressFromWallet(wallet);
26 const addr = need.addressFromWallet(wallet);
30
27