-
Notifications
You must be signed in to change notification settings - Fork 59
fix validation issues; fix typo; rm Add Asset btn #559
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -99,22 +99,27 @@ export const ManageAssetRows = ({ | |
| .build() | ||
| .toXDR(); | ||
|
|
||
| const trackChangeTrustline = () => { | ||
| emitMetric( | ||
| addTrustline | ||
| ? METRIC_NAMES.manageAssetAddAsset | ||
| : METRIC_NAMES.manageAssetRemoveAsset, | ||
| { assetCode, assetIssuer }, | ||
| ); | ||
| }; | ||
|
|
||
| if (isHardwareWallet) { | ||
| await dispatch(startHwSign({ transactionXDR })); | ||
| trackChangeTrustline(); | ||
| } else { | ||
| await signAndSubmit(transactionXDR); | ||
| dispatch(resetSubmission()); | ||
| navigateTo(ROUTES.account); | ||
| await signAndSubmit(transactionXDR, trackChangeTrustline); | ||
| } | ||
| emitMetric( | ||
| addTrustline | ||
| ? METRIC_NAMES.manageAssetAddAsset | ||
| : METRIC_NAMES.manageAssetRemoveAsset, | ||
| { assetCode, assetIssuer }, | ||
| ); | ||
| }; | ||
|
|
||
| const signAndSubmit = async (transactionXDR: string) => { | ||
| const signAndSubmit = async ( | ||
| transactionXDR: string, | ||
| trackChangeTrustline: () => void, | ||
| ) => { | ||
| const res = await dispatch( | ||
| signFreighterTransaction({ | ||
| transactionXDR, | ||
|
|
@@ -138,6 +143,14 @@ export const ManageAssetRows = ({ | |
| networkDetails, | ||
| }), | ||
| ); | ||
| trackChangeTrustline(); | ||
| dispatch(resetSubmission()); | ||
| navigateTo(ROUTES.account); | ||
| } | ||
|
|
||
| if (submitFreighterTransaction.rejected.match(submitResp)) { | ||
| setErrorAsset(assetSubmitting); | ||
| navigateTo(ROUTES.trustlineError); | ||
| } | ||
|
Contributor
Author
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. Handling a trustline error fell off in this release. Restoring it and refactor a bit to track properly |
||
| } | ||
| }; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -416,7 +416,10 @@ export const SendAmount = ({ | |
| <div className="SendAmount__btn-continue"> | ||
| <Button | ||
| disabled={ | ||
| loadingRate || formik.values.amount === "0" || !formik.isValid | ||
| loadingRate || | ||
| formik.values.amount === "0" || | ||
| !formik.isValid || | ||
| !destinationAmount | ||
|
Contributor
Author
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. Just noticed this bug: in a path payment, if there's no path available (for ex: using SRT in testnet), it still allows you to continue. Let's disable that bc the it will fail when you try to submit anyway |
||
| } | ||
| fullWidth | ||
| variant={Button.variant.tertiary} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,11 @@ import { useTranslation } from "react-i18next"; | |
|
|
||
| import { Button } from "popup/basics/buttons/Button"; | ||
| import { Onboarding } from "popup/components/Onboarding"; | ||
| import { FormError, FormRows, SubmitButtonWrapper } from "popup/basics/Forms"; | ||
| import { FullscreenStyle } from "popup/components/FullscreenStyle"; | ||
| import { Header } from "popup/components/Header"; | ||
| import { PasswordRequirements } from "popup/components/PasswordRequirements"; | ||
|
|
||
| import { ROUTES } from "popup/constants/routes"; | ||
| import { navigateTo } from "popup/helpers/navigate"; | ||
| import { | ||
|
|
@@ -19,10 +24,6 @@ import { | |
| publicKeySelector, | ||
| recoverAccount, | ||
| } from "popup/ducks/accountServices"; | ||
| import { FormRows, SubmitButtonWrapper } from "popup/basics/Forms"; | ||
| import { FullscreenStyle } from "popup/components/FullscreenStyle"; | ||
| import { Header } from "popup/components/Header"; | ||
| import { PasswordRequirements } from "popup/components/PasswordRequirements"; | ||
|
|
||
| import "./styles.scss"; | ||
|
|
||
|
|
@@ -65,6 +66,9 @@ const PhraseInput = ({ | |
| ); | ||
| }; | ||
|
|
||
| const buildMnemonicPhrase = (mnemonicPhraseArr: string[]) => | ||
| mnemonicPhraseArr.join(" ").trim(); | ||
|
|
||
| export const RecoverAccount = () => { | ||
| interface FormValues { | ||
| password: string; | ||
|
|
@@ -99,7 +103,7 @@ export const RecoverAccount = () => { | |
| await dispatch( | ||
| recoverAccount({ | ||
| password, | ||
| mnemonicPhrase: mnemonicPhraseArr.join(" ").trim(), | ||
| mnemonicPhrase: buildMnemonicPhrase(mnemonicPhraseArr), | ||
| }), | ||
| ); | ||
| }; | ||
|
|
@@ -157,7 +161,7 @@ export const RecoverAccount = () => { | |
| /> | ||
| ))} | ||
| </div> | ||
| <div>{authError}</div> | ||
| <FormError>{authError}</FormError> | ||
| </div> | ||
| <div className="RecoverAccount__half-screen"> | ||
| <FormRows> | ||
|
|
@@ -218,7 +222,13 @@ export const RecoverAccount = () => { | |
| <Button | ||
| fullWidth | ||
| isLoading={isSubmitting} | ||
| disabled={!(dirty && isValid)} | ||
| disabled={ | ||
| !( | ||
| dirty && | ||
| isValid && | ||
| buildMnemonicPhrase(mnemonicPhraseArr).length | ||
|
Contributor
Author
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. When Recovering using a mnemonic phrase, we need to manually check that the user has entered a phrase bc these are custom fields now, not Formik |
||
| ) | ||
| } | ||
| > | ||
| {t("IMPORT")} | ||
| </Button> | ||
|
|
||
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.
Remove the
Add Another Assetbtn if we're choosing an asset in a path payment