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

Amina/fix: error in investor password #8186

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
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}`);
}
hamid-deriv marked this conversation as resolved.
Show resolved Hide resolved
};
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 @@ -1615,7 +1615,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