Skip to content

Commit

Permalink
feat: improve multiple sol wallets support
Browse files Browse the repository at this point in the history
  • Loading branch information
icfor committed Apr 15, 2024
1 parent 57dd4be commit 6dd93ed
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ const UnstakingModal = () => {
? getStakeAccountsForNetwork(
stakingRef.current.state,
selectedAccount.networkId,
account?.address,
)
: []
).filter((acc) => ["activating", "active"].includes(acc.status));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const WithdrawUnstakedModal = () => {
? getStakeAccountsForNetwork(
stakingRef.current.state,
selectedAccount.networkId,
address,
)
: []
).filter((acc) => acc.status === "inactive");
Expand Down
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
Expand Up @@ -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)
Expand Down

0 comments on commit 6dd93ed

Please sign in to comment.