-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix/LIVE-11122]: update quotes when timeout reaches 0 in swap. #6118
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
e6ea02e
fix: update countdown and refresh rates code
kallen-ledger ff9589d
chore: add changeset
kallen-ledger 50f305f
fix: memoize providers and exchangeRates to stop unnecessary calls toβ¦
kallen-ledger f0b2e6c
chore: remove unimported files
kallen-ledger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@ledgerhq/live-common": minor | ||
"ledger-live-desktop": patch | ||
--- | ||
|
||
Return countdown and refresh rates from the useProviderRates hook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import React, { useMemo } from "react"; | ||
import React from "react"; | ||
import styled from "styled-components"; | ||
import SectionRate from "./SectionRate"; | ||
import { SwapDataType } from "@ledgerhq/live-common/exchange/swap/types"; | ||
|
@@ -10,28 +10,26 @@ const Form = styled.section` | |
`; | ||
type SwapFormProvidersProps = { | ||
swap: SwapDataType; | ||
countdownSecondsToRefresh: number | undefined; | ||
provider?: string; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above :) |
||
refreshTime: number; | ||
countdown: boolean; | ||
}; | ||
|
||
const SwapFormProviders = ({ swap, provider, refreshTime, countdown }: SwapFormProvidersProps) => { | ||
const SwapFormProviders = ({ | ||
swap, | ||
provider, | ||
countdownSecondsToRefresh, | ||
}: SwapFormProvidersProps) => { | ||
const { currency: fromCurrency } = swap.from; | ||
const { currency: toCurrency } = swap.to; | ||
|
||
const updatedRatesState = useMemo(() => { | ||
return swap.rates; | ||
}, [swap.rates]); | ||
|
||
return ( | ||
<Form> | ||
<SectionRate | ||
provider={provider} | ||
fromCurrency={fromCurrency} | ||
toCurrency={toCurrency} | ||
ratesState={updatedRatesState} | ||
refreshTime={refreshTime} | ||
countdown={countdown} | ||
ratesState={swap.rates} | ||
countdownSecondsToRefresh={countdownSecondsToRefresh} | ||
/> | ||
</Form> | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 6 additions & 25 deletions
31
apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Form/Rates/Countdown.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/Form/hooks/useRefreshRates.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 0 additions & 58 deletions
58
apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/utils/getRefreshTime.test.ts
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
apps/ledger-live-desktop/src/renderer/screens/exchange/Swap2/utils/getRefreshTime.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.