diff --git a/src/renderer/widgets/DelegateDetails/model/delegate-summary-model.ts b/src/renderer/widgets/DelegateDetails/model/delegate-summary-model.ts index 9c38754e00..f30c05bd27 100644 --- a/src/renderer/widgets/DelegateDetails/model/delegate-summary-model.ts +++ b/src/renderer/widgets/DelegateDetails/model/delegate-summary-model.ts @@ -5,7 +5,13 @@ import { combine, createEffect, createEvent, createStore, sample } from 'effecto import { delegationService, votingsService } from '@/shared/api/governance'; import { type Address, type Chain, type ChainId } from '@/shared/core'; import { MONTH, getBlockTimeAgo, nonNullable, setNestedValue } from '@/shared/lib/utils'; -import { type AggregatedReferendum, listAggregate, listService, networkSelectorModel } from '@/features/governance'; +import { + type AggregatedReferendum, + listAggregate, + listService, + networkSelectorModel, + proposerIdentityAggregate, +} from '@/features/governance'; import { getDelegationsList } from '../lib/utils'; import { delegateDetailsModel } from './delegate-details-model'; @@ -140,11 +146,20 @@ sample({ target: $votedReferendumsMonth, }); +sample({ + clock: $currentDelegations, + fn: (delegations) => ({ + addresses: delegations.map(([address]) => address), + }), + target: proposerIdentityAggregate.events.requestProposers, +}); + export const delegateSummaryModel = { $isModalOpen, $currentDelegations, $votedReferendums, $votedReferendumsMonth, + $proposers: proposerIdentityAggregate.$proposers, $isDelegatingLoading: getDelegatesFx.pending, $isReferendumsLoading: getReferendumsForVoterFx.pending, diff --git a/src/renderer/widgets/DelegateDetails/ui/DelegateSummary.tsx b/src/renderer/widgets/DelegateDetails/ui/DelegateSummary.tsx index 0ffe05e87f..77c7c195da 100644 --- a/src/renderer/widgets/DelegateDetails/ui/DelegateSummary.tsx +++ b/src/renderer/widgets/DelegateDetails/ui/DelegateSummary.tsx @@ -96,6 +96,7 @@ const EmptyState = () => { const DelegationsList = () => { const { t } = useI18n(); + const proposers = useUnit(delegateSummaryModel.$proposers); const currentDelegations = useUnit(delegateSummaryModel.$currentDelegations); const isDelegatingLoading = useUnit(delegateSummaryModel.$isDelegatingLoading); const chain = useUnit(delegateDetailsModel.$chain); @@ -120,7 +121,7 @@ const DelegationsList = () => { {currentDelegations.map(([address, delegation]) => (