Skip to content

Commit

Permalink
fix: remove errors in drawer (#7776)
Browse files Browse the repository at this point in the history
  • Loading branch information
CremaFR authored Sep 9, 2024
1 parent 77f9a5e commit 3eafc83
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 33 deletions.
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

0 comments on commit 3eafc83

Please sign in to comment.