aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts
diff options
context:
space:
mode:
authorkumavis <kumavis@users.noreply.github.com>2016-06-17 08:27:50 +0800
committerGitHub <noreply@github.com>2016-06-17 08:27:50 +0800
commitbdb113fabe9091b195d70f7f61246b6647b3b0a4 (patch)
treef5fdbfc8f997c1aeafee3074a2f143ed63c2d7e0 /app/scripts
parent6f19e9d5a9d246b8b7253865388042d45875c505 (diff)
parent65f9f997b002cd2a8a3eb0ba9dc12d7635cd4ec3 (diff)
downloadtangerine-wallet-browser-bdb113fabe9091b195d70f7f61246b6647b3b0a4.tar
tangerine-wallet-browser-bdb113fabe9091b195d70f7f61246b6647b3b0a4.tar.gz
tangerine-wallet-browser-bdb113fabe9091b195d70f7f61246b6647b3b0a4.tar.bz2
tangerine-wallet-browser-bdb113fabe9091b195d70f7f61246b6647b3b0a4.tar.lz
tangerine-wallet-browser-bdb113fabe9091b195d70f7f61246b6647b3b0a4.tar.xz
tangerine-wallet-browser-bdb113fabe9091b195d70f7f61246b6647b3b0a4.tar.zst
tangerine-wallet-browser-bdb113fabe9091b195d70f7f61246b6647b3b0a4.zip
Merge pull request #295 from MetaMask/AddDisclaimer
Create disclaimer view
Diffstat (limited to 'app/scripts')
-rw-r--r--app/scripts/background.js10
-rw-r--r--app/scripts/lib/config-manager.js11
-rw-r--r--app/scripts/lib/idStore.js1
3 files changed, 22 insertions, 0 deletions
diff --git a/app/scripts/background.js b/app/scripts/background.js
index f64209ecc..1098efe87 100644
--- a/app/scripts/background.js
+++ b/app/scripts/background.js
@@ -188,6 +188,7 @@ function setupControllerConnection(stream){
setRpcTarget: setRpcTarget,
setProviderType: setProviderType,
useEtherscanProvider: useEtherscanProvider,
+ agreeToDisclaimer: agreeToDisclaimer,
// forward directly to idStore
createNewVault: idStore.createNewVault.bind(idStore),
recoverFromSeed: idStore.recoverFromSeed.bind(idStore),
@@ -295,6 +296,15 @@ function addUnconfirmedMsg(msgParams, cb){
// config
//
+function agreeToDisclaimer(cb) {
+ try {
+ configManager.setConfirmed(true)
+ cb()
+ } catch (e) {
+ cb(e)
+ }
+}
+
// called from popup
function setRpcTarget(rpcTarget){
configManager.setRpcTarget(rpcTarget)
diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js
index f5e1cf38d..24571748f 100644
--- a/app/scripts/lib/config-manager.js
+++ b/app/scripts/lib/config-manager.js
@@ -270,6 +270,17 @@ ConfigManager.prototype._emitUpdates = function(state){
})
}
+ConfigManager.prototype.setConfirmed = function(confirmed) {
+ var data = this.getData()
+ data.isConfirmed = confirmed
+ this.setData(data)
+}
+
+ConfigManager.prototype.getConfirmed = function() {
+ var data = this.getData()
+ return ('isConfirmed' in data) && data.isConfirmed
+}
+
function loadData() {
diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js
index e9b9e0e06..a0bfa9d3a 100644
--- a/app/scripts/lib/idStore.js
+++ b/app/scripts/lib/idStore.js
@@ -92,6 +92,7 @@ IdentityStore.prototype.getState = function(){
isInitialized: !!configManager.getWallet() && !seedWords,
isUnlocked: this._isUnlocked(),
seedWords: seedWords,
+ isConfirmed: configManager.getConfirmed(),
unconfTxs: configManager.unconfirmedTxs(),
transactions: configManager.getTxList(),
unconfMsgs: messageManager.unconfirmedMsgs(),