aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/components/portal.tsx
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-01-10 19:39:37 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-01-10 19:43:50 +0800
commite34b0af25133629ad4c177c4d7d5050bd6ac19b8 (patch)
tree936eae17521984e5ccc28057973461e707322326 /packages/website/ts/components/portal.tsx
parentfa7237fde7acea32c5492f0dcdef4d55b3ade6e1 (diff)
downloaddexon-0x-contracts-e34b0af25133629ad4c177c4d7d5050bd6ac19b8.tar.gz
dexon-0x-contracts-e34b0af25133629ad4c177c4d7d5050bd6ac19b8.tar.zst
dexon-0x-contracts-e34b0af25133629ad4c177c4d7d5050bd6ac19b8.zip
Fix ts error in portal after enabling more strict checks
Diffstat (limited to 'packages/website/ts/components/portal.tsx')
-rw-r--r--packages/website/ts/components/portal.tsx10
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/website/ts/components/portal.tsx b/packages/website/ts/components/portal.tsx
index 22cdcbf20..e2e28e8b6 100644
--- a/packages/website/ts/components/portal.tsx
+++ b/packages/website/ts/components/portal.tsx
@@ -322,10 +322,10 @@ export class Portal extends React.Component<PortalAllProps, PortalAllState> {
isWethNoticeDialogOpen: false,
});
}
- private _getSharedOrderIfExists(): Order {
+ private _getSharedOrderIfExists(): Order | undefined {
const queryString = window.location.search;
if (queryString.length === 0) {
- return;
+ return undefined;
}
const queryParams = queryString.substring(1).split('&');
const orderQueryParam = _.find(queryParams, queryParam => {
@@ -333,11 +333,11 @@ export class Portal extends React.Component<PortalAllProps, PortalAllState> {
return queryPair[0] === 'order';
});
if (_.isUndefined(orderQueryParam)) {
- return;
+ return undefined;
}
const orderPair = orderQueryParam.split('=');
if (orderPair.length !== 2) {
- return;
+ return undefined;
}
const validator = new SchemaValidator();
@@ -345,7 +345,7 @@ export class Portal extends React.Component<PortalAllProps, PortalAllState> {
const validationResult = validator.validate(order, orderSchema);
if (validationResult.errors.length > 0) {
utils.consoleLog(`Invalid shared order: ${validationResult.errors}`);
- return;
+ return undefined;
}
return order;
}