Skip to content

Commit

Permalink
[EDW-931] Fix unlock modal didint clear field (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
doomdabidon committed Dec 23, 2019
1 parent bba3f83 commit b1f6d12
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 8 deletions.
1 change: 0 additions & 1 deletion COMMITHASH

This file was deleted.

8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ RUN npm i
COPY config ./config
COPY resources ./resources
COPY src ./src
COPY .babelrc ./
COPY webpack.config.js ./
COPY scripts ./scripts
COPY main ./main
COPY babel.config.js ./
COPY webpack-configs/webpack.config.web.babel.js ./webpack-configs/webpack.config.web.babel.js

RUN npm run build
RUN npm run build-web

FROM nginx:alpine

Expand Down
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"scripts": {
"start": "cross-env NODE_ENV=local node --trace-warnings -r @babel/register ./node_modules/webpack-dev-server/bin/webpack-dev-server --config webpack-configs/webpack.config.web.babel.js --mode development --progress --colors --history-api-fallback --hot --inline",
"prebuild": "rm -rf build/",
"build-web": "cross-env NODE_ENV=production webpack --config webpack-configs/webpack.config.web.babel.js ---display-error-details --colors --mode production",
"build": "cross-env ELECTRON=TRUE NODE_ENV=production webpack --config webpack-configs/webpack.config.web.babel.js --env.prod --env.electron --env.hash",
"build-main": "cross-env NODE_ENV=production webpack --config ./webpack-configs/webpack.config.main.babel.js --colors",
"lint": "node_modules/.bin/eslint 'src/**/*.jsx' 'src/**/*.js'",
Expand Down
17 changes: 16 additions & 1 deletion src/components/Modals/ModalUnlock.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,26 @@ import { Modal, Form, Button } from 'semantic-ui-react';
import PropTypes from 'prop-types';
import { injectIntl } from 'react-intl';
import FocusLock from 'react-focus-lock';
import _ from 'lodash';

import PasswordInput from '../PasswordInput';

class ModalUnlockWallet extends React.Component {

constructor(props) {
super(props);
this.state = {

this.DEFAULT_STATE = {
password: '',
};

this.state = _.cloneDeep(this.DEFAULT_STATE);
}

componentDidUpdate(prevProps) {
if (prevProps.show !== this.props.show) {
this.clear();
}
}

onForgot(e) {
Expand All @@ -34,6 +45,10 @@ class ModalUnlockWallet extends React.Component {
this.props.change(e.target.value.trim());
}

clear() {
this.setState(_.cloneDeep(this.DEFAULT_STATE));
}

render() {
const {
show, error, disabled, intl,
Expand Down
7 changes: 5 additions & 2 deletions src/containers/AuthorizationScenario/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class AuthorizationScenario extends React.Component {
}

clear() {
this.props.clear(MODAL_UNLOCK);
this.setState(_.cloneDeep(this.DEFAULT_STATE));
}

Expand Down Expand Up @@ -60,9 +61,11 @@ class AuthorizationScenario extends React.Component {
.catch(() => this.setState({ unlockLoading: false }));
}

close() {
close(modal) {
this.clear();
this.setState({ unlock: false });
if (modal) {
this.props.closeModal(modal);
}
}

forgot() {
Expand Down

0 comments on commit b1f6d12

Please sign in to comment.