Unverified Commit 758c5430 authored by Amaury Martiny's avatar Amaury Martiny Committed by GitHub
Browse files

feat: Add timeout on confirmation screens (#540)

* Add timer

* Add Timer on confirmation screen

* Put idle timer on Scan confirmation too

* Fix lint

* Alphabet

* Small optimization

* Fix lint
parent 929ed29e
Pipeline #50570 failed with stages
in 15 minutes and 48 seconds
......@@ -66,6 +66,7 @@
"react-final-form": "^3.6.4",
"react-final-form-listeners": "^1.0.1",
"react-i18next": "^10.2.0",
"react-idle-timer": "^4.2.9",
"react-markdown": "^3.3.4",
"react-resize-detector": "^3.0.1",
"react-router-dom": "^4.2.2",
......@@ -87,4 +88,4 @@
"not ie <= 11",
"not op_mini all"
]
}
\ No newline at end of file
}
......@@ -7,6 +7,7 @@ import React, { Component } from 'react';
import { Field, Form } from 'react-final-form';
import { Form as FetherForm, Header } from 'fether-ui';
import { inject, observer } from 'mobx-react';
import IdleTimer from 'react-idle-timer';
import { Link } from 'react-router-dom';
import { withProps } from 'recompose';
......@@ -27,6 +28,10 @@ import withTokens from '../../utils/withTokens';
@withEthBalance // ETH or ETC balance
@observer
class SignedTxSummary extends Component {
handleGoToTxForm = () => {
this.props.history.go(-3);
};
handleSubmit = values => {
const {
account: { address },
......@@ -52,6 +57,8 @@ class SignedTxSummary extends Component {
return (
<div>
<IdleTimer onIdle={this.handleGoToTxForm} timeout={1000 * 60} />
<Header
left={
<Link to={`/tokens/${address}`} className='icon -back'>
......
......@@ -7,6 +7,7 @@ import React, { Component } from 'react';
import { Field, Form } from 'react-final-form';
import { Form as FetherForm, Header } from 'fether-ui';
import { inject, observer } from 'mobx-react';
import IdleTimer from 'react-idle-timer';
import { Link, Redirect } from 'react-router-dom';
import { withProps } from 'recompose';
......@@ -57,6 +58,8 @@ class Unlock extends Component {
return (
<div>
<IdleTimer onIdle={history.goBack} timeout={1000 * 60} />
<Header
left={
<Link to={`/tokens/${address}`} className='icon -back'>
......@@ -73,7 +76,6 @@ class Unlock extends Component {
)
}
/>
<RequireHealthOverlay require='sync'>
<div className='window_content'>
<div className='box -padded'>
......
......@@ -12720,6 +12720,11 @@ react-i18next@^10.2.0:
"@babel/runtime" "^7.3.1"
html-parse-stringify2 "2.0.1"
 
react-idle-timer@^4.2.9:
version "4.2.9"
resolved "https://registry.yarnpkg.com/react-idle-timer/-/react-idle-timer-4.2.9.tgz#9054dc508953521e76fd5255f692ec8a816c304c"
integrity sha512-Bj1SaHdCS+YiWgASgmZtr5MEWfsyIg9AWGdpSKbrzlsjpEXYuCe1dsuAetY0ES81w3sz98oUBBj25T4Hl7JXqg==
react-is@^16.7.0, react-is@^16.8.1:
version "16.8.6"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment