Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
a30c0fd6
Commit
a30c0fd6
authored
Nov 07, 2024
by
isstuev
Committed by
tom goriunov
Nov 08, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
token transfer total is possibly null
parent
6a5ee48d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
18 additions
and
12 deletions
+18
-12
tokenTransfer.ts
types/api/tokenTransfer.ts
+4
-4
TokenTransferListItem.tsx
ui/shared/TokenTransfer/TokenTransferListItem.tsx
+1
-1
TokenTransferTableItem.tsx
ui/shared/TokenTransfer/TokenTransferTableItem.tsx
+1
-1
TokenTransferSnippet.tsx
ui/shared/TokenTransferSnippet/TokenTransferSnippet.tsx
+8
-2
TokenTransferListItem.tsx
ui/token/TokenTransfer/TokenTransferListItem.tsx
+1
-1
TokenTransferTableItem.tsx
ui/token/TokenTransfer/TokenTransferTableItem.tsx
+1
-1
TokenTransfersListItem.tsx
ui/tokenTransfers/TokenTransfersListItem.tsx
+1
-1
TokenTransfersTableItem.tsx
ui/tokenTransfers/TokenTransfersTableItem.tsx
+1
-1
No files found.
types/api/tokenTransfer.ts
View file @
a30c0fd6
...
@@ -27,19 +27,19 @@ export type Erc404TotalPayload = {
...
@@ -27,19 +27,19 @@ export type Erc404TotalPayload = {
export
type
TokenTransfer
=
(
export
type
TokenTransfer
=
(
{
{
token
:
TokenInfo
<
'
ERC-20
'
>
;
token
:
TokenInfo
<
'
ERC-20
'
>
;
total
:
Erc20TotalPayload
;
total
:
Erc20TotalPayload
|
null
;
}
|
}
|
{
{
token
:
TokenInfo
<
'
ERC-721
'
>
;
token
:
TokenInfo
<
'
ERC-721
'
>
;
total
:
Erc721TotalPayload
;
total
:
Erc721TotalPayload
|
null
;
}
|
}
|
{
{
token
:
TokenInfo
<
'
ERC-1155
'
>
;
token
:
TokenInfo
<
'
ERC-1155
'
>
;
total
:
Erc1155TotalPayload
;
total
:
Erc1155TotalPayload
|
null
;
}
|
}
|
{
{
token
:
TokenInfo
<
'
ERC-404
'
>
;
token
:
TokenInfo
<
'
ERC-404
'
>
;
total
:
Erc404TotalPayload
;
total
:
Erc404TotalPayload
|
null
;
}
}
)
&
TokenTransferBase
)
&
TokenTransferBase
...
...
ui/shared/TokenTransfer/TokenTransferListItem.tsx
View file @
a30c0fd6
...
@@ -36,7 +36,7 @@ const TokenTransferListItem = ({
...
@@ -36,7 +36,7 @@ const TokenTransferListItem = ({
enableTimeIncrement
,
enableTimeIncrement
,
isLoading
,
isLoading
,
}:
Props
)
=>
{
}:
Props
)
=>
{
const
{
usd
,
valueStr
}
=
'
value
'
in
total
&&
total
.
value
!==
null
?
getCurrencyValue
({
const
{
usd
,
valueStr
}
=
total
&&
'
value
'
in
total
&&
total
.
value
!==
null
?
getCurrencyValue
({
value
:
total
.
value
,
value
:
total
.
value
,
exchangeRate
:
token
.
exchange_rate
,
exchangeRate
:
token
.
exchange_rate
,
accuracy
:
8
,
accuracy
:
8
,
...
...
ui/shared/TokenTransfer/TokenTransferTableItem.tsx
View file @
a30c0fd6
...
@@ -35,7 +35,7 @@ const TokenTransferTableItem = ({
...
@@ -35,7 +35,7 @@ const TokenTransferTableItem = ({
enableTimeIncrement
,
enableTimeIncrement
,
isLoading
,
isLoading
,
}:
Props
)
=>
{
}:
Props
)
=>
{
const
{
usd
,
valueStr
}
=
'
value
'
in
total
&&
total
.
value
!==
null
?
getCurrencyValue
({
const
{
usd
,
valueStr
}
=
total
&&
'
value
'
in
total
&&
total
.
value
!==
null
?
getCurrencyValue
({
value
:
total
.
value
,
value
:
total
.
value
,
exchangeRate
:
token
.
exchange_rate
,
exchangeRate
:
token
.
exchange_rate
,
accuracy
:
8
,
accuracy
:
8
,
...
...
ui/shared/TokenTransferSnippet/TokenTransferSnippet.tsx
View file @
a30c0fd6
...
@@ -30,7 +30,10 @@ const TokenTransferSnippet = ({ data, isLoading, noAddressIcons = true }: Props)
...
@@ -30,7 +30,10 @@ const TokenTransferSnippet = ({ data, isLoading, noAddressIcons = true }: Props)
switch
(
data
.
token
.
type
)
{
switch
(
data
.
token
.
type
)
{
case
'
ERC-20
'
:
{
case
'
ERC-20
'
:
{
const
total
=
data
.
total
as
Erc20TotalPayload
;
const
total
=
data
.
total
as
Erc20TotalPayload
|
null
;
if
(
total
===
null
||
total
.
value
===
null
)
{
return
null
;
}
return
<
TokenTransferSnippetFiat
token=
{
data
.
token
}
value=
{
total
.
value
}
decimals=
{
total
.
decimals
}
/>;
return
<
TokenTransferSnippetFiat
token=
{
data
.
token
}
value=
{
total
.
value
}
decimals=
{
total
.
decimals
}
/>;
}
}
...
@@ -58,7 +61,10 @@ const TokenTransferSnippet = ({ data, isLoading, noAddressIcons = true }: Props)
...
@@ -58,7 +61,10 @@ const TokenTransferSnippet = ({ data, isLoading, noAddressIcons = true }: Props)
}
}
case
'
ERC-404
'
:
{
case
'
ERC-404
'
:
{
const
total
=
data
.
total
as
Erc404TotalPayload
;
const
total
=
data
.
total
as
Erc404TotalPayload
|
null
;
if
(
total
===
null
)
{
return
null
;
}
if
(
total
.
token_id
!==
null
)
{
if
(
total
.
token_id
!==
null
)
{
return
(
return
(
...
...
ui/token/TokenTransfer/TokenTransferListItem.tsx
View file @
a30c0fd6
...
@@ -26,7 +26,7 @@ const TokenTransferListItem = ({
...
@@ -26,7 +26,7 @@ const TokenTransferListItem = ({
tokenId
,
tokenId
,
isLoading
,
isLoading
,
}:
Props
)
=>
{
}:
Props
)
=>
{
const
{
usd
,
valueStr
}
=
'
value
'
in
total
&&
total
.
value
!==
null
?
getCurrencyValue
({
const
{
usd
,
valueStr
}
=
total
&&
'
value
'
in
total
&&
total
.
value
!==
null
?
getCurrencyValue
({
value
:
total
.
value
,
value
:
total
.
value
,
exchangeRate
:
token
.
exchange_rate
,
exchangeRate
:
token
.
exchange_rate
,
accuracy
:
8
,
accuracy
:
8
,
...
...
ui/token/TokenTransfer/TokenTransferTableItem.tsx
View file @
a30c0fd6
...
@@ -24,7 +24,7 @@ const TokenTransferTableItem = ({
...
@@ -24,7 +24,7 @@ const TokenTransferTableItem = ({
tokenId
,
tokenId
,
isLoading
,
isLoading
,
}:
Props
)
=>
{
}:
Props
)
=>
{
const
{
usd
,
valueStr
}
=
'
value
'
in
total
&&
total
.
value
!==
null
?
getCurrencyValue
({
const
{
usd
,
valueStr
}
=
total
&&
'
value
'
in
total
&&
total
.
value
!==
null
?
getCurrencyValue
({
value
:
total
.
value
,
value
:
total
.
value
,
exchangeRate
:
token
.
exchange_rate
,
exchangeRate
:
token
.
exchange_rate
,
accuracy
:
8
,
accuracy
:
8
,
...
...
ui/tokenTransfers/TokenTransfersListItem.tsx
View file @
a30c0fd6
...
@@ -21,7 +21,7 @@ type Props = {
...
@@ -21,7 +21,7 @@ type Props = {
const
TokenTransfersListItem
=
({
item
,
isLoading
}:
Props
)
=>
{
const
TokenTransfersListItem
=
({
item
,
isLoading
}:
Props
)
=>
{
const
{
valueStr
}
=
'
value
'
in
item
.
total
&&
item
.
total
.
value
!==
null
?
getCurrencyValue
({
const
{
valueStr
}
=
item
.
total
&&
'
value
'
in
item
.
total
&&
item
.
total
.
value
!==
null
?
getCurrencyValue
({
value
:
item
.
total
.
value
,
value
:
item
.
total
.
value
,
exchangeRate
:
item
.
token
.
exchange_rate
,
exchangeRate
:
item
.
token
.
exchange_rate
,
accuracy
:
8
,
accuracy
:
8
,
...
...
ui/tokenTransfers/TokenTransfersTableItem.tsx
View file @
a30c0fd6
...
@@ -19,7 +19,7 @@ type Props = {
...
@@ -19,7 +19,7 @@ type Props = {
}
}
const
TokenTransferTableItem
=
({
item
,
isLoading
}:
Props
)
=>
{
const
TokenTransferTableItem
=
({
item
,
isLoading
}:
Props
)
=>
{
const
{
valueStr
}
=
'
value
'
in
item
.
total
&&
item
.
total
.
value
!==
null
?
getCurrencyValue
({
const
{
valueStr
}
=
item
.
total
&&
'
value
'
in
item
.
total
&&
item
.
total
.
value
!==
null
?
getCurrencyValue
({
value
:
item
.
total
.
value
,
value
:
item
.
total
.
value
,
exchangeRate
:
item
.
token
.
exchange_rate
,
exchangeRate
:
item
.
token
.
exchange_rate
,
accuracy
:
8
,
accuracy
:
8
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment