1import { useEffect, useMemo, useState } from 'react';
2import * as need from 'lib/need';
3import { Just } from 'folktale/maybe';
4import { usePointCache } from 'store/pointCache';
5import { usePointCursor } from 'store/pointCursor';
6import { convertToInt } from 'lib/convertToInt';
8export const useHasNetworkKeysSet = () => {
9 const { pointCursor }: any = usePointCursor();
10 const { getDetails }: any = usePointCache();
11 const point = pointCursor.getOrElse(null);
12 const [networkKeysSet, setNetworkKeysSet] = useState<boolean>(true);
15 if (point && Just.hasInstance(getDetails(point))) {
16 const details = need.details(getDetails(point));
17 const networkRevision = convertToInt(details.keyRevisionNumber, 10);
18 setNetworkKeysSet(networkRevision > 0);
20 }, [getDetails, point, pointCursor]);
22 return useMemo(() => {
23 return networkKeysSet;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list