Skip to content

Commit

Permalink
Amina/fix: error in investor password (#8186)
Browse files Browse the repository at this point in the history
* fix: error in investor password

* fix: investor password
  • Loading branch information
amina-deriv authored Apr 12, 2023
1 parent cd35387 commit 0b10511
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
14 changes: 1 addition & 13 deletions packages/cfd/src/Containers/cfd-reset-password-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,7 @@ import RootStore from '../Stores/index';
import React from 'react';
import { withRouter } from 'react-router-dom';
import { Button, Icon, PasswordMeter, PasswordInput, FormSubmitButton, Loading, Modal, Text } from '@deriv/components';
import {
routes,
validLength,
validPassword,
getErrorMessages,
CFD_PLATFORMS,
WS,
redirectToLogin,
} from '@deriv/shared';
import { validLength, validPassword, getErrorMessages, CFD_PLATFORMS, WS, redirectToLogin } from '@deriv/shared';
import { localize, Localize, getLanguage } from '@deriv/translations';
import { connect } from '../Stores/connect';
import { getMtCompanies, TMtCompanies } from '../Stores/Modules/CFD/Helpers/cfd-config';
Expand Down Expand Up @@ -61,7 +53,6 @@ const CFDResetPasswordModal = ({
is_logged_in,
platform,
setCFDPasswordResetModal,
history,
}: TCFDResetPasswordModal) => {
const [state, setState] = React.useState<{
error_code: string | number | undefined;
Expand Down Expand Up @@ -89,9 +80,6 @@ const CFDResetPasswordModal = ({
localStorage.removeItem('cfd_reset_password_intent');
localStorage.removeItem('cfd_reset_password_type');
localStorage.removeItem('cfd_reset_password_code');
if (history.location.pathname !== routes.mt5) {
history.push(`${routes.mt5}`);
}
};
const validatePassword = (values: { new_password: string }) => {
const errors: { new_password?: string } = {};
Expand Down
3 changes: 1 addition & 2 deletions packages/cfd/src/Containers/props.types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { RouteComponentProps } from 'react-router';
import {
DetailsOfEachMT5Loginid,
GetAccountStatus,
Expand Down Expand Up @@ -79,7 +78,7 @@ export type TError = {
message: string;
};

export type TCFDResetPasswordModal = RouteComponentProps & {
export type TCFDResetPasswordModal = {
current_list: Record<string, DetailsOfEachMT5Loginid>;
email: string;
context?: RootStore;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/Stores/client-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -1616,7 +1616,7 @@ export default class ClientStore extends BaseStore {

this.responsePayoutCurrencies(await WS.authorized.payoutCurrencies());
if (this.is_logged_in) {
WS.storage.mt5LoginList().then(this.responseMt5LoginList);
await WS.mt5LoginList().then(this.responseMt5LoginList);
WS.tradingServers(CFD_PLATFORMS.MT5).then(this.responseMT5TradingServers);

WS.tradingPlatformAvailableAccounts(CFD_PLATFORMS.MT5).then(this.responseTradingPlatformAvailableAccounts);
Expand Down

0 comments on commit 0b10511

Please sign in to comment.