Skip to content

Commit

Permalink
perf(multisig): poll current network vaults info
Browse files Browse the repository at this point in the history
  • Loading branch information
CedrikNikita committed Jun 27, 2024
1 parent deaa5d0 commit 260a033
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/composables/multisigAccounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function useMultisigAccounts({
pollOnce = false,
pollingDisabled = false,
}: MultisigAccountsOptions = {}) {
const { onNetworkChange } = useNetworks();
const { activeNetwork, onNetworkChange } = useNetworks();
const { aeActiveNetworkPredefinedSettings } = useAeNetworkSettings();
const { nodeNetworkId, getAeSdk, getDryAeSdk } = useAeSdk();
const { aeAccounts } = useAccounts();
Expand Down Expand Up @@ -256,6 +256,7 @@ export function useMultisigAccounts({
}

async function getAllMultisigAccountsInfo(rawMultisigData: IMultisigAccountResponse[]) {
const currentNetworkName = activeNetwork.value.name;
/**
* Splitting the rawMultisigData is required to not overload the node
* with amount of parallel dry-runs
Expand All @@ -265,6 +266,9 @@ export function useMultisigAccounts({
const results: IMultisigAccount[] = [];
/* eslint-disable-next-line no-restricted-syntax */
for (const nestedArray of splittedMultisig) {
if (currentNetworkName !== activeNetwork.value.name) {
return [];
}
// Process each nested array sequentially
const promises = nestedArray.map(
(rawData: IMultisigAccountResponse) => getMultisigAccountInfo(rawData),
Expand Down

0 comments on commit 260a033

Please sign in to comment.