Skip to content

Commit 8162f45

Browse files
authored
Merge pull request #204 from kaleido-io/tokenPool-details-bug
[tokenPool-details-bug]
2 parents e638e20 + b5d0d9f commit 8162f45

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/pages/Tokens/views/PoolDetails.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ export const PoolDetails: () => JSX.Element = () => {
140140

141141
// Pool balances
142142
useEffect(() => {
143-
if (pool && isMounted) {
143+
if (isMounted && poolID) {
144144
fetchCatcher(
145-
`${FF_Paths.nsPrefix}/${selectedNamespace}${FF_Paths.tokenBalances}?pool=${pool?.id}`
145+
`${FF_Paths.nsPrefix}/${selectedNamespace}${FF_Paths.tokenBalances}?pool=${poolID}`
146146
)
147147
.then(async (balances: ITokenBalance[]) => {
148148
if (balances.length === 0) {
@@ -167,20 +167,21 @@ export const PoolDetails: () => JSX.Element = () => {
167167
reportFetchError(err);
168168
});
169169
}
170-
}, [pool, isMounted]);
170+
}, [isMounted, poolID]);
171171

172172
// Token transfers and accounts
173173
useEffect(() => {
174174
setTokenTransfers(undefined);
175175

176176
isMounted &&
177177
dateFilter &&
178+
poolID &&
178179
fetchCatcher(
179180
`${FF_Paths.nsPrefix}/${selectedNamespace}${
180181
FF_Paths.tokenTransfers
181182
}?limit=${rowsPerPage}&count&skip=${rowsPerPage * currentPage}${
182183
dateFilter.filterString
183-
}&pool=${pool?.id}`
184+
}&pool=${poolID}`
184185
)
185186
.then(async (tokenTransferRes: IPagedTokenTransferResponse) => {
186187
if (isMounted) {
@@ -213,7 +214,7 @@ export const PoolDetails: () => JSX.Element = () => {
213214
dateFilter,
214215
currentPage,
215216
selectedNamespace,
216-
pool,
217+
poolID,
217218
isMounted,
218219
]);
219220

@@ -262,7 +263,8 @@ export const PoolDetails: () => JSX.Element = () => {
262263
const accountsCard: IFireFlyCard = {
263264
headerText: t('accountsInPool'),
264265
clickPath:
265-
pool && FF_NAV_PATHS.tokensBalancesPathByPool(selectedNamespace, pool.id),
266+
poolID &&
267+
FF_NAV_PATHS.tokensBalancesPathByPool(selectedNamespace, poolID),
266268
component: (
267269
<MediumCardTable
268270
records={poolAccountsRecords}
@@ -396,7 +398,9 @@ export const PoolDetails: () => JSX.Element = () => {
396398
container
397399
>
398400
<Grid container item justifyContent="flex-start" xs={2}>
399-
<Jazzicon diameter={34} seed={jsNumberForAddress(pool.id)} />
401+
{poolID && (
402+
<Jazzicon diameter={34} seed={jsNumberForAddress(poolID)} />
403+
)}
400404
</Grid>
401405
<Grid container item justifyContent="flex-start" xs={10}>
402406
<Typography
@@ -480,7 +484,7 @@ export const PoolDetails: () => JSX.Element = () => {
480484
dashboardSize
481485
clickPath={FF_NAV_PATHS.tokensTransfersPath(
482486
selectedNamespace,
483-
pool?.id
487+
poolID
484488
)}
485489
/>
486490
</Grid>

0 commit comments

Comments
 (0)