Skip to content

Commit 7144113

Browse files
Merge pull request #567 from PolymathNetwork/fix/navigate-non-existing-checkpoint
fix(new-issuer): url access to non-existing checkpoint
2 parents 9168151 + 2221677 commit 7144113

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

  • packages/new-polymath-issuer/src/pages/DividendsWizard

packages/new-polymath-issuer/src/pages/DividendsWizard/Container.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { ActionType } from 'typesafe-actions';
1919
import { DividendModuleTypes } from '@polymathnetwork/sdk';
2020
import { BigNumber } from 'bignumber.js';
2121
import { Page } from '@polymathnetwork/new-ui';
22-
import { range, padStart, flatten, map, every, values } from 'lodash';
22+
import { range, padStart, flatten, map, every, values, keys } from 'lodash';
2323
import { polyClient } from '~/lib/polyClient';
2424
import { GetErc20BalanceByAddressAndWalletArgs } from '~/types';
2525
import { push } from 'redux-little-router';
@@ -240,7 +240,12 @@ export class ContainerBase extends Component<Props, State> {
240240
const dividendsListUrl = `/securityTokens/${securityTokenSymbol}/dividends`;
241241

242242
const checkpointsList = values(dividendsData);
243-
if (checkpointsList.length === 0) {
243+
if (
244+
checkpointsList.length === 0 ||
245+
!keys(dividendsData).find(checkpointId => {
246+
return checkpointId === checkpointIndex;
247+
})
248+
) {
244249
// No checkpoints exist
245250
dispatch(push(dividendsListUrl));
246251
}

0 commit comments

Comments
 (0)