|
|
|
@ -2,7 +2,6 @@ import { createSelector } from 'reselect';
|
|
|
|
|
|
|
|
|
|
|
|
import { StateType } from '../reducer';
|
|
|
|
import { StateType } from '../reducer';
|
|
|
|
import { OnionState } from '../ducks/onion';
|
|
|
|
import { OnionState } from '../ducks/onion';
|
|
|
|
import { Snode } from '../../data/data';
|
|
|
|
|
|
|
|
import { SectionType } from '../../state/ducks/section';
|
|
|
|
import { SectionType } from '../../state/ducks/section';
|
|
|
|
|
|
|
|
|
|
|
|
export const getOnionPaths = (state: StateType): OnionState => state.onionPaths;
|
|
|
|
export const getOnionPaths = (state: StateType): OnionState => state.onionPaths;
|
|
|
|
@ -14,12 +13,12 @@ export const getOnionPathsCount = createSelector(
|
|
|
|
|
|
|
|
|
|
|
|
export const getFirstOnionPath = createSelector(
|
|
|
|
export const getFirstOnionPath = createSelector(
|
|
|
|
getOnionPaths,
|
|
|
|
getOnionPaths,
|
|
|
|
(state: OnionState): Array<Snode> => state.snodePaths?.[0] || []
|
|
|
|
(state: OnionState): Array<{ ip: string }> => state.snodePaths?.[0] || []
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
export const getFirstOnionPathLength = createSelector(
|
|
|
|
export const getFirstOnionPathLength = createSelector(
|
|
|
|
getFirstOnionPath,
|
|
|
|
getFirstOnionPath,
|
|
|
|
(state: Array<Snode>): number => state.length || 0
|
|
|
|
(state: Array<{ ip: string }>): number => state.length || 0
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
export const getIsOnline = createSelector(
|
|
|
|
export const getIsOnline = createSelector(
|
|
|
|
|