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
40f0e619
Unverified
Commit
40f0e619
authored
May 04, 2021
by
Noah Zinsmeister
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix additional base currency toggle bugs
parent
bd817083
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
8 deletions
+6
-8
index.tsx
src/pages/AddLiquidity/index.tsx
+5
-2
MigrateV2Pair.tsx
src/pages/MigrateV2/MigrateV2Pair.tsx
+1
-6
No files found.
src/pages/AddLiquidity/index.tsx
View file @
40f0e619
...
@@ -89,6 +89,7 @@ export default function AddLiquidity({
...
@@ -89,6 +89,7 @@ export default function AddLiquidity({
[
currencyA
,
currencyB
,
baseCurrency
]
[
currencyA
,
currencyB
,
baseCurrency
]
)
)
// url params are the source truth, so we have to do this
useEffect
(()
=>
{
useEffect
(()
=>
{
setBaseCurrency
(
currencyA
)
setBaseCurrency
(
currencyA
)
return
()
=>
{
return
()
=>
{
...
@@ -449,7 +450,8 @@ export default function AddLiquidity({
...
@@ -449,7 +450,8 @@ export default function AddLiquidity({
handleRateToggle=
{
()
=>
{
handleRateToggle=
{
()
=>
{
onLeftRangeInput
(
''
)
onLeftRangeInput
(
''
)
onRightRangeInput
(
''
)
onRightRangeInput
(
''
)
setBaseCurrency
(
quoteCurrency
)
console
.
log
(
'
test
'
)
history
.
push
(
`/add/${currencyIdB as string}/${currencyIdA as string}`
)
}
}
}
}
/>
/>
)
:
null
}
)
:
null
}
...
@@ -490,7 +492,8 @@ export default function AddLiquidity({
...
@@ -490,7 +492,8 @@ export default function AddLiquidity({
handleRateToggle=
{
()
=>
{
handleRateToggle=
{
()
=>
{
onLeftRangeInput
(
''
)
onLeftRangeInput
(
''
)
onRightRangeInput
(
''
)
onRightRangeInput
(
''
)
setBaseCurrency
(
quoteCurrency
)
console
.
log
(
'
test
'
)
history
.
push
(
`/add/${currencyIdB as string}/${currencyIdA as string}`
)
}
}
}
}
/>
/>
)
:
null
}
)
:
null
}
...
...
src/pages/MigrateV2/MigrateV2Pair.tsx
View file @
40f0e619
import
React
,
{
useCallback
,
use
Effect
,
use
Memo
,
useState
}
from
'
react
'
import
React
,
{
useCallback
,
useMemo
,
useState
}
from
'
react
'
import
{
Fraction
,
Price
,
Token
,
TokenAmount
,
WETH9
}
from
'
@uniswap/sdk-core
'
import
{
Fraction
,
Price
,
Token
,
TokenAmount
,
WETH9
}
from
'
@uniswap/sdk-core
'
import
{
FACTORY_ADDRESS
,
JSBI
}
from
'
@uniswap/v2-sdk
'
import
{
FACTORY_ADDRESS
,
JSBI
}
from
'
@uniswap/v2-sdk
'
import
{
Redirect
,
RouteComponentProps
}
from
'
react-router
'
import
{
Redirect
,
RouteComponentProps
}
from
'
react-router
'
...
@@ -163,11 +163,6 @@ function V2PairMigration({
...
@@ -163,11 +163,6 @@ function V2PairMigration({
baseToken
baseToken
)
)
// reset the initial state, dont need cleanup token always defined
useEffect
(()
=>
{
setBaseToken
(
token0
)
},
[
baseToken
,
token0
])
// get value and prices at ticks
// get value and prices at ticks
const
{
[
Bound
.
LOWER
]:
tickLower
,
[
Bound
.
UPPER
]:
tickUpper
}
=
ticks
const
{
[
Bound
.
LOWER
]:
tickLower
,
[
Bound
.
UPPER
]:
tickUpper
}
=
ticks
const
{
[
Bound
.
LOWER
]:
priceLower
,
[
Bound
.
UPPER
]:
priceUpper
}
=
pricesAtTicks
const
{
[
Bound
.
LOWER
]:
priceLower
,
[
Bound
.
UPPER
]:
priceUpper
}
=
pricesAtTicks
...
...
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