Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve multiple sol wallets support
Browse files Browse the repository at this point in the history
icfor committed Apr 15, 2024
1 parent 57dd4be commit 6dd93ed
Showing 3 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -139,6 +139,7 @@ const UnstakingModal = () => {
? getStakeAccountsForNetwork(
stakingRef.current.state,
selectedAccount.networkId,
account?.address,
)
: []
).filter((acc) => ["activating", "active"].includes(acc.status));
Original file line number Diff line number Diff line change
@@ -57,6 +57,7 @@ const WithdrawUnstakedModal = () => {
? getStakeAccountsForNetwork(
stakingRef.current.state,
selectedAccount.networkId,
address,
)
: []
).filter((acc) => acc.status === "inactive");
2 changes: 2 additions & 0 deletions src/screens/staking/lib/staking_sdk/context/selectors.ts
Original file line number Diff line number Diff line change
@@ -62,11 +62,13 @@ export const getAccountsForNetwork = (
export const getStakeAccountsForNetwork = (
state: StakingState,
network: StakingNetworkId,
parentAddress?: string,
) => {
const accounts = getAccountsForNetwork(state, network);
const uniqueAccounts = new Set<string>();

return accounts
.filter(parentAddress ? (acc) => acc.address === parentAddress : () => true)
.map((account) => account.info?.stakeAccounts)
.flat()
.filter((a): a is StakeAccount => !!a)

0 comments on commit 6dd93ed

Please sign in to comment.