aboutsummaryrefslogtreecommitdiffstats
path: root/old-ui
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@gmail.com>2018-07-03 07:48:26 +0800
committerAlexander Tseung <alextsg@gmail.com>2018-07-03 07:48:26 +0800
commit86e95b283bd64debe9ca888abef716bc1eecce9c (patch)
treea6675fc72b711b87574be361b9a3cd222b5b333c /old-ui
parent9f11042d72c15b1725fb5f4b6484cc9d9583b34b (diff)
downloadtangerine-wallet-browser-86e95b283bd64debe9ca888abef716bc1eecce9c.tar
tangerine-wallet-browser-86e95b283bd64debe9ca888abef716bc1eecce9c.tar.gz
tangerine-wallet-browser-86e95b283bd64debe9ca888abef716bc1eecce9c.tar.bz2
tangerine-wallet-browser-86e95b283bd64debe9ca888abef716bc1eecce9c.tar.lz
tangerine-wallet-browser-86e95b283bd64debe9ca888abef716bc1eecce9c.tar.xz
tangerine-wallet-browser-86e95b283bd64debe9ca888abef716bc1eecce9c.tar.zst
tangerine-wallet-browser-86e95b283bd64debe9ca888abef716bc1eecce9c.zip
Fix notice screen incorrectly disabling Accept button after multiple notices
Diffstat (limited to 'old-ui')
-rw-r--r--old-ui/app/components/notice.js17
1 files changed, 15 insertions, 2 deletions
diff --git a/old-ui/app/components/notice.js b/old-ui/app/components/notice.js
index 09d461c7b..1ec254555 100644
--- a/old-ui/app/components/notice.js
+++ b/old-ui/app/components/notice.js
@@ -116,12 +116,25 @@ Notice.prototype.render = function () {
)
}
+Notice.prototype.setInitialDisclaimerState = function () {
+ if (document.getElementsByClassName('notice-box')[0].clientHeight < 310) {
+ this.setState({disclaimerDisabled: false})
+ }
+}
+
Notice.prototype.componentDidMount = function () {
// eslint-disable-next-line react/no-find-dom-node
var node = findDOMNode(this)
linker.setupListener(node)
- if (document.getElementsByClassName('notice-box')[0].clientHeight < 310) {
- this.setState({disclaimerDisabled: false})
+ this.setInitialDisclaimerState()
+}
+
+Notice.prototype.componentDidUpdate = function (prevProps) {
+ const { notice: { id } = {} } = this.props
+ const { notice: { id: prevNoticeId } = {} } = prevProps
+
+ if (id !== prevNoticeId) {
+ this.setInitialDisclaimerState()
}
}