forked from tahowallet/extension
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request tahowallet#542 from tallycash/reverse-safety
Reverse Safety: Fix autolock clearing keyring metadata for good
- Loading branch information
Showing
4 changed files
with
22 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
import { createSelector } from "@reduxjs/toolkit" | ||
import { RootState } from ".." | ||
|
||
export const selectIsCurrentAccountSigner = createSelector( | ||
(state: RootState) => | ||
state.keyrings.keyrings.flatMap((keyring) => keyring.addresses), | ||
(state: RootState) => state.ui.currentAccount, | ||
(addresses, selectedAccount) => addresses.includes(selectedAccount.address) | ||
) | ||
|
||
export const selectKeyringStatus = createSelector( | ||
(state: RootState) => state.keyrings.status, | ||
(status) => status | ||
) | ||
|
||
export const selectSigningAddresses = createSelector( | ||
(state: RootState) => | ||
state.keyrings.keyrings.flatMap((keyring) => keyring.addresses), | ||
(addresses) => addresses | ||
(state: RootState) => state.keyrings.keyrings, | ||
(keyrings) => keyrings.flatMap((keyring) => keyring.addresses) | ||
) | ||
|
||
export const selectIsCurrentAccountSigner = createSelector( | ||
selectSigningAddresses, | ||
(state: RootState) => state.ui.currentAccount, | ||
(signingAddresses, selectedAccount) => | ||
signingAddresses.includes(selectedAccount.address) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters