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
6cb0824a
Unverified
Commit
6cb0824a
authored
Jan 19, 2023
by
Zach Pomerantz
Committed by
GitHub
Jan 19, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: rm "approval failed" UI (#5861)
parent
777887b2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
9 deletions
+1
-9
index.tsx
src/pages/Swap/index.tsx
+1
-9
No files found.
src/pages/Swap/index.tsx
View file @
6cb0824a
...
...
@@ -28,7 +28,7 @@ import JSBI from 'jsbi'
import
{
formatSwapQuoteReceivedEventProperties
}
from
'
lib/utils/analytics
'
import
{
useCallback
,
useEffect
,
useMemo
,
useState
}
from
'
react
'
import
{
ReactNode
}
from
'
react
'
import
{
A
lertTriangle
,
A
rrowDown
,
CheckCircle
,
HelpCircle
,
Info
}
from
'
react-feather
'
import
{
ArrowDown
,
CheckCircle
,
HelpCircle
,
Info
}
from
'
react-feather
'
import
{
useNavigate
}
from
'
react-router-dom
'
import
{
Text
}
from
'
rebass
'
import
{
useToggleWalletModal
}
from
'
state/application/hooks
'
...
...
@@ -316,7 +316,6 @@ export default function Swap({ className }: { className?: string }) {
)
const
isApprovalLoading
=
allowance
.
state
===
AllowanceState
.
REQUIRED
&&
allowance
.
isApprovalLoading
const
[
isAllowancePending
,
setIsAllowancePending
]
=
useState
(
false
)
const
[
isAllowanceFailed
,
setIsAllowanceFailed
]
=
useState
(
false
)
const
updateAllowance
=
useCallback
(
async
()
=>
{
invariant
(
allowance
.
state
===
AllowanceState
.
REQUIRED
)
setIsAllowancePending
(
true
)
...
...
@@ -327,10 +326,8 @@ export default function Swap({ className }: { className?: string }) {
token_symbol
:
maximumAmountIn
?.
currency
.
symbol
,
token_address
:
maximumAmountIn
?.
currency
.
address
,
})
setIsAllowanceFailed
(
false
)
}
catch
(
e
)
{
console
.
error
(
e
)
setIsAllowanceFailed
(
true
)
}
finally
{
setIsAllowancePending
(
false
)
}
...
...
@@ -804,11 +801,6 @@ export default function Swap({ className }: { className?: string }) {
<
Loader
size=
"20px"
/>
<
Trans
>
Approve in your wallet
</
Trans
>
</>
)
:
isAllowanceFailed
?
(
<>
<
AlertTriangle
size=
{
20
}
/>
<
Trans
>
Approval failed. Try again.
</
Trans
>
</>
)
:
isApprovalLoading
?
(
<>
<
Loader
size=
"20px"
/>
...
...
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