@@ -2,27 +2,21 @@ import { useEffect, useMemo, useState } from 'react';
2import * as need from 'lib/need';
2import * as need from 'lib/need';
3import { usePointCache } from 'store/pointCache';
3import { usePointCache } from 'store/pointCache';
4import { usePointCursor } from 'store/pointCursor';
4import { usePointCursor } from 'store/pointCursor';
5−import { useRollerStore } from 'store/roller';
6import { convertToInt } from 'lib/convertToInt';
5import { convertToInt } from 'lib/convertToInt';
7−import { isPlanet } from 'lib/utils/point';
9export const useHasNetworkKeysSet = () => {
7export const useHasNetworkKeysSet = () => {
10 const { pointCursor } = usePointCursor();
8 const { pointCursor } = usePointCursor();
11 const { getDetails } = usePointCache();
9 const { getDetails } = usePointCache();
12− const { currentL2 } = useRollerStore();
13 const point = pointCursor.getOrElse(null);
10 const point = pointCursor.getOrElse(null);
14 const [networkKeysSet, setNetworkKeysSet] = useState<boolean>(true);
11 const [networkKeysSet, setNetworkKeysSet] = useState<boolean>(true);
16 useEffect(() => {
13 useEffect(() => {
17 if (point) {
14 if (point) {
18 const details = need.details(getDetails(point));
15 const details = need.details(getDetails(point));
19− const isStarOrGalaxy = !isPlanet(point);
20 const networkRevision = convertToInt(details.keyRevisionNumber, 10);
16 const networkRevision = convertToInt(details.keyRevisionNumber, 10);
21− const networkKeysNotSet =
22− !currentL2 && isStarOrGalaxy && networkRevision === 0;
23− setNetworkKeysSet(!networkKeysNotSet);
17+ setNetworkKeysSet(networkRevision > 0);
25− }, [currentL2, getDetails, point, pointCursor]);
19+ }, [getDetails, point, pointCursor]);
27 return useMemo(() => {
21 return useMemo(() => {
28 return networkKeysSet;
22 return networkKeysSet;