Update: Adds displayBitcoinCoreFlag
This commit is contained in:
parent
8d9631200b
commit
195e9190c5
3 changed files with 22 additions and 14 deletions
|
|
@ -249,18 +249,5 @@ angular.module('copayApp.services').factory('configService', function(storageSer
|
||||||
return lodash.clone(defaultConfig);
|
return lodash.clone(defaultConfig);
|
||||||
};
|
};
|
||||||
|
|
||||||
root.checkIfConfigIsSet = function(key) {
|
|
||||||
return new Promise(function(resolve, reject) {
|
|
||||||
storageService.getConfig(function(err, localConfig) {
|
|
||||||
if (localConfig) {
|
|
||||||
configCache = JSON.parse(localConfig);
|
|
||||||
resolve(configCache.hasOwnProperty(key));
|
|
||||||
} else {
|
|
||||||
reject(false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return root;
|
return root;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1038,7 +1038,7 @@ angular.module('copayApp.services')
|
||||||
};
|
};
|
||||||
|
|
||||||
root.initBitcoinCoreDisplay = function() {
|
root.initBitcoinCoreDisplay = function() {
|
||||||
configService.checkIfConfigIsSet('displayBitcoinCore').then(function(result) {
|
storageService.checkIfFlagIsSet('displayBitcoinCoreFlag').then(function(result) {
|
||||||
if (!result) {
|
if (!result) {
|
||||||
var walletsBtc = root.getWallets({coin: 'btc'});
|
var walletsBtc = root.getWallets({coin: 'btc'});
|
||||||
var totalBtc = 0;
|
var totalBtc = 0;
|
||||||
|
|
@ -1057,6 +1057,8 @@ angular.module('copayApp.services')
|
||||||
configService.set(opts, function(err) {
|
configService.set(opts, function(err) {
|
||||||
if (err) $log.debug(err);
|
if (err) $log.debug(err);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
storageService.activateDisplayBitcoinCoreFlag();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -634,5 +634,24 @@ angular.module('copayApp.services')
|
||||||
storage.remove('receivedTxs-' + walletId, cb);
|
storage.remove('receivedTxs-' + walletId, cb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
root.checkIfFlagIsSet = function(key) {
|
||||||
|
return new Promise(function(resolve, reject) {
|
||||||
|
storage.get(key, function(i, value) {
|
||||||
|
if (value == null) {
|
||||||
|
resolve(false);
|
||||||
|
} else {
|
||||||
|
resolve(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
root.activateDisplayBitcoinCoreFlag = function() {
|
||||||
|
var flag = {
|
||||||
|
initialized: true
|
||||||
|
};
|
||||||
|
storage.set('displayBitcoinCoreFlag', flag, function() { });
|
||||||
|
}
|
||||||
|
|
||||||
return root;
|
return root;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue