Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
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
LuckySwap
interface
Commits
94aa8ae2
Unverified
Commit
94aa8ae2
authored
Jan 19, 2023
by
Zach Pomerantz
Committed by
GitHub
Jan 19, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: avoid error swap state while loading (#5860)
fix: omit price impact warning while loading
parent
6cb0824a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
prices.test.ts
src/utils/prices.test.ts
+2
-2
prices.ts
src/utils/prices.ts
+1
-1
No files found.
src/utils/prices.test.ts
View file @
94aa8ae2
...
...
@@ -119,8 +119,8 @@ describe('prices', () => {
})
describe
(
'
#warningSeverity
'
,
()
=>
{
it
(
'
max
for undefined
'
,
()
=>
{
expect
(
warningSeverity
(
undefined
)).
toEqual
(
4
)
it
(
'
0
for undefined
'
,
()
=>
{
expect
(
warningSeverity
(
undefined
)).
toEqual
(
0
)
})
it
(
'
correct for 0
'
,
()
=>
{
expect
(
warningSeverity
(
new
Percent
(
0
))).
toEqual
(
0
)
...
...
src/utils/prices.ts
View file @
94aa8ae2
...
...
@@ -84,7 +84,7 @@ const IMPACT_TIERS = [
type
WarningSeverity
=
0
|
1
|
2
|
3
|
4
export
function
warningSeverity
(
priceImpact
:
Percent
|
undefined
):
WarningSeverity
{
if
(
!
priceImpact
)
return
4
if
(
!
priceImpact
)
return
0
let
impact
:
WarningSeverity
=
IMPACT_TIERS
.
length
as
WarningSeverity
for
(
const
impactLevel
of
IMPACT_TIERS
)
{
if
(
impactLevel
.
lessThan
(
priceImpact
))
return
impact
...
...
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