diff --git a/apps/deploy-web/src/components/authorizations/AllowanceGrantedRow.tsx b/apps/deploy-web/src/components/authorizations/AllowanceGrantedRow.tsx index ea3f5c780..ec6ed6575 100644 --- a/apps/deploy-web/src/components/authorizations/AllowanceGrantedRow.tsx +++ b/apps/deploy-web/src/components/authorizations/AllowanceGrantedRow.tsx @@ -16,7 +16,7 @@ type Props = { }; export const AllowanceGrantedRow: React.FunctionComponent = ({ allowance, selected, onSelect }) => { - const limit = allowance?.allowance.spend_limit[0]; + const limit = allowance?.allowance?.spend_limit?.[0]; return ( @@ -25,8 +25,13 @@ export const AllowanceGrantedRow: React.FunctionComponent = ({ allowance, {getAllowanceTitleByType(allowance)} {allowance.granter &&
} - {limit && } - {limit && "AKT"} + {limit ? ( + <> + AKT + + ) : ( + Unlimited + )} {} diff --git a/apps/deploy-web/src/components/authorizations/AllowanceIssuedRow.tsx b/apps/deploy-web/src/components/authorizations/AllowanceIssuedRow.tsx index 0a51dcd35..cce880fe8 100644 --- a/apps/deploy-web/src/components/authorizations/AllowanceIssuedRow.tsx +++ b/apps/deploy-web/src/components/authorizations/AllowanceIssuedRow.tsx @@ -19,6 +19,8 @@ type Props = { }; export const AllowanceIssuedRow: React.FunctionComponent = ({ allowance, checked, onEditAllowance, setDeletingAllowance, onSelectAllowance }) => { + const limit = allowance?.allowance?.spend_limit?.[0]; + return ( {getAllowanceTitleByType(allowance)} @@ -26,7 +28,13 @@ export const AllowanceIssuedRow: React.FunctionComponent = ({ allowance,
- AKT + {limit ? ( + <> + AKT + + ) : ( + Unlimited + )} diff --git a/apps/deploy-web/src/components/authorizations/GranteeRow.tsx b/apps/deploy-web/src/components/authorizations/GranteeRow.tsx index 0231e25cb..eac5f86c8 100644 --- a/apps/deploy-web/src/components/authorizations/GranteeRow.tsx +++ b/apps/deploy-web/src/components/authorizations/GranteeRow.tsx @@ -14,7 +14,8 @@ type Props = { }; export const GranteeRow: React.FunctionComponent = ({ grant }) => { - const denomData = useDenomData(grant.authorization.spend_limit.denom); + const limit = grant?.authorization?.spend_limit; + const denomData = limit ? useDenomData(limit.denom) : null; return ( @@ -22,7 +23,13 @@ export const GranteeRow: React.FunctionComponent = ({ grant }) => {
- {denomData?.label} + {limit ? ( + <> + {denomData?.label} + + ) : ( + Unlimited + )}