black color easter egg

This commit is contained in:
Gabriel Bazán 2016-06-29 15:59:58 -03:00
commit 5b81a1ba9b
2 changed files with 24 additions and 2 deletions

View file

@ -15,7 +15,7 @@
</span>
</li>
<li class="line-b p20 oh">
<li class="line-b p20 oh" ng-click="saveBlack()">
<span translate>Wallet Name (at creation)</span>
<span class="right text-gray">
{{walletName}}

View file

@ -1,10 +1,14 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesInformation',
function($scope, $log, $timeout, platformInfo, gettextCatalog, lodash, profileService, storageService, go, bitcore) {
function($scope, $log, $timeout, platformInfo, gettextCatalog, lodash, profileService, storageService, configService, go, bitcore) {
var base = 'xpub';
var fc = profileService.focusedClient;
var c = fc.credentials;
var walletId = c.walletId;
var config = configService.getSync();
var b = 1;
config.colorFor = config.colorFor || {};
$scope.init = function() {
var basePath = c.getBaseAddressDerivationPath();
@ -89,4 +93,22 @@ angular.module('copayApp.controllers').controller('preferencesInformation',
}, 100);
};
$scope.saveBlack = function() {
function save(color) {
var opts = {
colorFor: {}
};
opts.colorFor[walletId] = color;
configService.set(opts, function(err) {
go.walletHome();
if (err) $log.warn(err);
$scope.$emit('Local/ColorUpdated');
});
};
if (b != 5) return b++;
save('#202020');
}
});