Skip to content

Commit c48b60d

Browse files
authored
Merge pull request #528 from MetaMask/checkout-fix
Fix ether warning checkbox to reflect proper behavior.
2 parents ffb4802 + db57795 commit c48b60d

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

app/scripts/lib/config-manager.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,13 @@ ConfigManager.prototype.getConfirmed = function () {
274274
return ('isConfirmed' in data) && data.isConfirmed
275275
}
276276

277-
ConfigManager.prototype.setShouldntShowWarning = function (confirmed) {
277+
ConfigManager.prototype.setShouldntShowWarning = function () {
278278
var data = this.getData()
279-
data.isEthConfirmed = confirmed
279+
if (data.isEthConfirmed) {
280+
data.isEthConfirmed = !data.isEthConfirmed
281+
} else {
282+
data.isEthConfirmed = true
283+
}
280284
this.setData(data)
281285
}
282286

app/scripts/metamask-controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ module.exports = class MetamaskController {
243243

244244
agreeToEthWarning (cb) {
245245
try {
246-
this.configManager.setShouldntShowWarning(true)
246+
this.configManager.setShouldntShowWarning()
247247
cb()
248248
} catch (e) {
249249
cb(e)

ui/app/reducers/metamask.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ function reduceMetamask (state, action) {
1010
var metamaskState = extend({
1111
isInitialized: false,
1212
isUnlocked: false,
13+
isEthConfirmed: false,
1314
currentDomain: 'example.com',
1415
rpcTarget: 'https://rawtestrpc.metamask.io/',
1516
identities: {},
@@ -33,7 +34,7 @@ function reduceMetamask (state, action) {
3334

3435
case actions.AGREE_TO_ETH_WARNING:
3536
return extend(metamaskState, {
36-
isEthConfirmed: true,
37+
isEthConfirmed: !metamaskState.isEthConfirmed,
3738
})
3839

3940
case actions.UNLOCK_METAMASK:

0 commit comments

Comments
 (0)