Skip to content

Commit

Permalink
feat: added isEnabling selector
Browse files Browse the repository at this point in the history
  • Loading branch information
cazala committed Mar 26, 2020
1 parent f3f80b9 commit 53b272f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/modules/wallet/selectors.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { isLoadingType } from '../loading/selectors'

import { CONNECT_WALLET_REQUEST } from './actions'
import { CONNECT_WALLET_REQUEST, ENABLE_WALLET_REQUEST } from './actions'
import { WalletState } from './reducer'

export const getState: (state: any) => WalletState = state => state.wallet
Expand All @@ -11,6 +11,8 @@ export const getError = (state: any) => getState(state).error
export const isConnected = (state: any) => getData(state) !== null
export const isConnecting = (state: any) =>
isLoadingType(getLoading(state), CONNECT_WALLET_REQUEST)
export const isEnabling = (state: any) =>
isLoadingType(getLoading(state), ENABLE_WALLET_REQUEST)

export const getNetwork = (state: any) =>
isConnected(state) ? getData(state)!.network : undefined
Expand Down

0 comments on commit 53b272f

Please sign in to comment.