Skip to content

Commit

Permalink
poll for offline/online status when wallet decrypt mounts
Browse files Browse the repository at this point in the history
  • Loading branch information
dternyak committed Dec 29, 2017
1 parent 4fd3330 commit e7f2889
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions common/components/WalletDecrypt/WalletDecrypt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
resetWallet,
TResetWallet
} from 'actions/wallet';
import { pollOfflineStatus, TPollOfflineStatus } from 'actions/config';
import { reset, TReset } from 'actions/transaction';
import translate from 'translations';
import {
Expand Down Expand Up @@ -44,6 +45,7 @@ import './WalletDecrypt.scss';
type UnlockParams = {} | PrivateKeyValue;

interface Props {
pollOfflineStatus: TPollOfflineStatus;
resetTransactionState: TReset;
unlockKeystore: TUnlockKeystore;
unlockMnemonic: TUnlockMnemonic;
Expand Down Expand Up @@ -177,11 +179,16 @@ export class WalletDecrypt extends Component<Props, State> {
isReadOnly: true
}
};

public state: State = {
selectedWalletKey: null,
value: null
};

public componentDidMount() {
this.props.pollOfflineStatus();
}

public componentWillReceiveProps(nextProps) {
// Reset state when unlock is hidden / revealed
if (nextProps.hidden !== this.props.hidden) {
Expand Down Expand Up @@ -389,5 +396,6 @@ export default connect(mapStateToProps, {
unlockWeb3,
setWallet,
resetWallet,
pollOfflineStatus,
resetTransactionState: reset
})(WalletDecrypt);

0 comments on commit e7f2889

Please sign in to comment.