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

Recompose tx when opening send form from token row #16020

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ export const TokenSelect = ({ outputId }: TokenSelectProps) => {
composeTransaction,
watch,
setValue,
setDraftSaveRequest,
} = useSendFormContext();

const dispatch = useDispatch();
Expand Down Expand Up @@ -172,13 +171,13 @@ export const TokenSelect = ({ outputId }: TokenSelectProps) => {
useEffect(() => {
if (sendFormPrefill) {
setValue(tokenInputName, sendFormPrefill, { shouldValidate: true, shouldDirty: true });
setDraftSaveRequest(true);
composeTransaction(tokenInputName);
dispatch({
type: SUITE.SET_SEND_FORM_PREFILL,
payload: '',
});
}
}, [sendFormPrefill, setValue, tokenInputName, setDraftSaveRequest, dispatch]);
}, [sendFormPrefill, setValue, tokenInputName, composeTransaction, dispatch]);

const tokensWithRates = enhanceTokensWithRates(
account.tokens,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from 'styled-components';

import { selectSelectedDevice, sendFormActions } from '@suite-common/wallet-core';
import { selectSelectedDevice } from '@suite-common/wallet-core';
import { Account, TokenAddress } from '@suite-common/wallet-types';
import { Network, getCoingeckoId } from '@suite-common/wallet-config';
import {
Expand Down Expand Up @@ -494,11 +494,6 @@ export const TokenRow = ({
type: SUITE.SET_SEND_FORM_PREFILL,
payload: token.contract,
});
dispatch(
sendFormActions.removeDraft({
accountKey: account.key,
}),
);
goToWithAnalytics('wallet-send', {
params: {
symbol: account.symbol,
Expand Down
Loading