Skip to content
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: remove errors in drawer #7776

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/happy-onions-know.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": minor
---

fix: remove error from btc fee drawer
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ import CoinControlModal from "./CoinControlModal";
import { FeesField } from "./FeesField";
import { BitcoinFamily } from "./types";
import useBitcoinPickingStrategy from "./useBitcoinPickingStrategy";
import Alert from "~/renderer/components/Alert";
import TranslatedError from "~/renderer/components/TranslatedError";
import { useDispatch } from "react-redux";
import { useHistory } from "react-router";
import { closeAllModal } from "~/renderer/actions/modals";
import { setTrackingSource } from "~/renderer/analytics/TrackPage";
import { Flex } from "@ledgerhq/react-ui";

type Props = NonNullable<BitcoinFamily["sendAmountFields"]>["component"];

Expand Down Expand Up @@ -53,25 +46,6 @@ const Fields: Props = ({
const { item } = useBitcoinPickingStrategy(transaction.utxoStrategy.strategy);
const canNext = account.bitcoinResources?.utxos?.length;

const dispatch = useDispatch();
const history = useHistory();

const onBuyClick = useCallback(() => {
dispatch(closeAllModal());
setTrackingSource("send flow");
history.push({
pathname: "/exchange",
state: {
currency: account.currency.id,
account: account.id,
mode: "buy", // buy or sell
},
});
}, [account.currency.id, account.id, dispatch, history]);

const { errors } = status;
const { amount: messageAmount } = errors;

/* TODO: How do we set default RBF to be true ? (@gre)
* Meanwhile, using this trick (please don't kill me)
*/
Expand Down Expand Up @@ -183,13 +157,6 @@ const Fields: Props = ({
mapStrategies={mapStrategies}
status={status}
/>
{messageAmount && (
<Flex onClick={onBuyClick}>
<Alert type="warning">
<TranslatedError error={messageAmount} />
</Alert>
</Flex>
)}
</>
)}
</>
Expand Down
Loading