Skip to content

Commit

Permalink
Merge branch 'master' of github.com:binary-com/deriv-app into aum/PRO…
Browse files Browse the repository at this point in the history
…DQA-38/client-redirection-to-correct-withdrawal-page-using-loginid
  • Loading branch information
aum-deriv committed Jul 4, 2023
2 parents 523f979 + 7a3b458 commit d124777
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import React from 'react';
import { useHistory } from 'react-router-dom';
import { Modal, Text } from '@deriv/components';
import { routes, getStaticUrl, PlatformContext } from '@deriv/shared';
import { Localize } from '@deriv/translations';
import { getStaticUrl, PlatformContext } from '@deriv/shared';
import { connect } from 'Stores/connect';
import { TCoreStore } from 'Stores/index';

const AccountClosed = ({ logout }) => {
type TAccountClosed = {
logout: () => void;
};

const AccountClosed = ({ logout }: TAccountClosed) => {
const [is_modal_open, setModalState] = React.useState(true);
const [timer, setTimer] = React.useState(10);
const { is_appstore } = React.useContext(PlatformContext);
const history = useHistory();

const counter = React.useCallback(() => {
if (timer > 0) {
Expand All @@ -20,7 +23,7 @@ const AccountClosed = ({ logout }) => {
}, [is_appstore, timer]);

React.useEffect(() => {
history.push(routes.root);
window.history.pushState(null, '', '/');
logout();
const handleInterval = setInterval(() => counter(), 1000);
return () => {
Expand All @@ -42,6 +45,6 @@ const AccountClosed = ({ logout }) => {
);
};

export default connect(({ client }) => ({
export default connect(({ client }: TCoreStore) => ({
logout: client.logout,
}))(AccountClosed);

0 comments on commit d124777

Please sign in to comment.