commit
c10bcf0cdb
7 changed files with 72 additions and 95 deletions
|
|
@ -1,7 +1,6 @@
|
||||||
<div class="splash content text-center"
|
<div class="splash content text-center"
|
||||||
ng-init="init()"
|
|
||||||
ng-controller="disclaimerController">
|
ng-controller="disclaimerController">
|
||||||
<div ng-if="!agreed">
|
<div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="container-image large-2 medium-2 small-2 medium-centered small-centered large-centered columns">
|
<div class="container-image large-2 medium-2 small-2 medium-centered small-centered large-centered columns">
|
||||||
<img src="img/icon-splash.png" alt="icon" width="100%">
|
<img src="img/icon-splash.png" alt="icon" width="100%">
|
||||||
|
|
@ -15,6 +14,7 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="scrollArea">
|
<div class="scrollArea">
|
||||||
<p class="enable_text_select m0">
|
<p class="enable_text_select m0">
|
||||||
|
<div class="size-16 text-gray" translate>Terms of Use</div>
|
||||||
<ul>
|
<ul>
|
||||||
<li translate>The software you are about to use functions as a free, open source, and multi-signature digital wallet.</li>
|
<li translate>The software you are about to use functions as a free, open source, and multi-signature digital wallet.</li>
|
||||||
<li translate>The software does not constitute an account where BitPay or other third parties serve as financial intermediaries or custodians of your bitcoin.</li>
|
<li translate>The software does not constitute an account where BitPay or other third parties serve as financial intermediaries or custodians of your bitcoin.</li>
|
||||||
|
|
@ -33,21 +33,24 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-center size-12 text-warning" ng-show="error">
|
|
||||||
{{(error)|translate}}. <span translate>Retrying...</span>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<p ng-show="lang != 'en'">
|
<p ng-show="lang != 'en'">
|
||||||
<a class="center" ng-click="$root.openExternalLink('https://copay.io/disclaimer')" translate>Official English Disclaimer</a>
|
<a class="center" ng-click="$root.openExternalLink('https://copay.io/disclaimer')" translate>Official English Disclaimer</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div ng-show="!agreed">
|
<div>
|
||||||
<p class="text-gray columns" translate>I affirm that I have read, understood, and agree with these terms.</p>
|
<p class="text-gray columns" translate>I affirm that I have read, understood, and agree with these terms.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="text-center size-12 text-warning" ng-show="error">
|
||||||
|
{{(error)|translate}}. <span translate>Retrying...</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="start-button columns">
|
<div class="start-button columns">
|
||||||
<button ng-disabled="noProfile" ng-click="create()" class="button black expand round size-12 text-spacing" translate>
|
<button ng-disabled="creatingProfile" ng-click="goHome()" class="button black expand round size-12 text-spacing" translate>
|
||||||
GET STARTED
|
I AGREE. GET STARTED
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1107,7 +1107,13 @@ input.ng-invalid-match, input.ng-invalid-match:focus {
|
||||||
|
|
||||||
.scrollArea ul {
|
.scrollArea ul {
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
text-align: left;
|
text-align: justify;
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.scrollArea li {
|
||||||
|
list-style-type:none;
|
||||||
|
display: inline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabbable {
|
.tabbable {
|
||||||
|
|
|
||||||
|
|
@ -1,38 +1,37 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('disclaimerController',
|
angular.module('copayApp.controllers').controller('disclaimerController',
|
||||||
function($scope, $timeout, $log, profileService, isCordova, storageService, gettextCatalog, applicationService, uxLanguage, go) {
|
function($scope, $timeout, $log, profileService, isCordova, storageService, gettextCatalog, uxLanguage, go) {
|
||||||
self = this;
|
self = this;
|
||||||
$scope.noProfile = true;
|
$scope.lang = uxLanguage.currentLanguage;
|
||||||
|
|
||||||
$scope.create = function() {
|
$scope.goHome = function() {
|
||||||
storageService.setCopayDisclaimerFlag(function(err) {
|
go.walletHome();
|
||||||
applicationService.restart();
|
};
|
||||||
|
|
||||||
|
var create = function () {
|
||||||
|
$scope.creatingProfile = true;
|
||||||
|
profileService.create({}, function(err) {
|
||||||
|
|
||||||
|
if (err) {
|
||||||
|
|
||||||
|
if (err == 'EEXISTS')
|
||||||
|
return go.walletHome();
|
||||||
|
|
||||||
|
$log.warn(err);
|
||||||
|
$scope.error = err;
|
||||||
|
$scope.$apply();
|
||||||
|
$timeout(function() {
|
||||||
|
$log.warn('Retrying to create profile......');
|
||||||
|
create();
|
||||||
|
}, 3000);
|
||||||
|
} else {
|
||||||
|
$scope.error = "";
|
||||||
|
$scope.creatingProfile = false;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.init = function(noWallet) {
|
// create();
|
||||||
storageService.getCopayDisclaimerFlag(function(err, val) {
|
|
||||||
$scope.lang = uxLanguage.currentLanguage;
|
|
||||||
$scope.agreed = val;
|
|
||||||
|
|
||||||
profileService.create({
|
|
||||||
noWallet: noWallet
|
|
||||||
}, function(err) {
|
|
||||||
if (err && !'EEXIST') {
|
|
||||||
$log.warn(err);
|
|
||||||
$scope.error = err;
|
|
||||||
$scope.$apply();
|
|
||||||
$scope.noProfile = true;
|
|
||||||
$timeout(function() {
|
|
||||||
$scope.init();
|
|
||||||
}, 3000);
|
|
||||||
} else {
|
|
||||||
$scope.error = "";
|
|
||||||
$scope.noProfile = false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1295,17 +1295,14 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
$rootScope.$on('Local/NewFocusedWallet', function() {
|
$rootScope.$on('Local/NewFocusedWallet', function() {
|
||||||
self.setFocusedWallet();
|
self.setFocusedWallet();
|
||||||
self.updateTxHistory();
|
self.updateTxHistory();
|
||||||
storageService.getCopayDisclaimerFlag(function(err, val) {
|
storageService.getCleanAndScanAddresses(function(err, walletId) {
|
||||||
if (val) go.walletHome();
|
if (walletId && profileService.walletClients[walletId]) {
|
||||||
storageService.getCleanAndScanAddresses(function(err, walletId) {
|
$log.debug('Clear last address cache and Scan ', walletId);
|
||||||
if (walletId && profileService.walletClients[walletId]) {
|
addressService.expireAddress(walletId, function(err) {
|
||||||
$log.debug('Clear last address cache and Scan ', walletId);
|
self.startScan(walletId);
|
||||||
addressService.expireAddress(walletId, function(err) {
|
});
|
||||||
self.startScan(walletId);
|
storageService.removeCleanAndScanAddresses(function() {});
|
||||||
});
|
}
|
||||||
storageService.removeCleanAndScanAddresses(function() {});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -75,17 +75,6 @@ angular
|
||||||
// link: http://stackoverflow.com/questions/15606751/angular-changes-urls-to-unsafe-in-extension-page?lq=1
|
// link: http://stackoverflow.com/questions/15606751/angular-changes-urls-to-unsafe-in-extension-page?lq=1
|
||||||
$compileProvider.imgSrcSanitizationWhitelist(/^\s*((https?|ftp|file|blob|chrome-extension):|data:image\/)/);
|
$compileProvider.imgSrcSanitizationWhitelist(/^\s*((https?|ftp|file|blob|chrome-extension):|data:image\/)/);
|
||||||
|
|
||||||
$stateProvider
|
|
||||||
.state('splash', {
|
|
||||||
url: '/splash',
|
|
||||||
needProfile: false,
|
|
||||||
views: {
|
|
||||||
'main': {
|
|
||||||
templateUrl: 'views/splash.html',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$stateProvider
|
$stateProvider
|
||||||
.state('translators', {
|
.state('translators', {
|
||||||
url: '/translators',
|
url: '/translators',
|
||||||
|
|
@ -521,9 +510,6 @@ angular
|
||||||
if (err) {
|
if (err) {
|
||||||
if (err.message && err.message.match('NOPROFILE')) {
|
if (err.message && err.message.match('NOPROFILE')) {
|
||||||
$log.debug('No profile... redirecting');
|
$log.debug('No profile... redirecting');
|
||||||
$state.transitionTo('splash');
|
|
||||||
} else if (err.message && err.message.match('NONAGREEDDISCLAIMER')) {
|
|
||||||
$log.debug('Display disclaimer... redirecting');
|
|
||||||
$state.transitionTo('disclaimer');
|
$state.transitionTo('disclaimer');
|
||||||
} else {
|
} else {
|
||||||
throw new Error(err); // TODO
|
throw new Error(err); // TODO
|
||||||
|
|
|
||||||
|
|
@ -134,32 +134,26 @@ angular.module('copayApp.services')
|
||||||
};
|
};
|
||||||
|
|
||||||
root.loadAndBindProfile = function(cb) {
|
root.loadAndBindProfile = function(cb) {
|
||||||
storageService.getCopayDisclaimerFlag(function(err, val) {
|
storageService.getProfile(function(err, profile) {
|
||||||
if (!val) {
|
if (err) {
|
||||||
return cb(new Error('NONAGREEDDISCLAIMER: Non agreed disclaimer'));
|
$rootScope.$emit('Local/DeviceError', err);
|
||||||
} else {
|
return cb(err);
|
||||||
storageService.getProfile(function(err, profile) {
|
|
||||||
if (err) {
|
|
||||||
$rootScope.$emit('Local/DeviceError', err);
|
|
||||||
return cb(err);
|
|
||||||
}
|
|
||||||
if (!profile) {
|
|
||||||
// Migration??
|
|
||||||
storageService.tryToMigrate(function(err, migratedProfile) {
|
|
||||||
if (err) return cb(err);
|
|
||||||
if (!migratedProfile)
|
|
||||||
return cb(new Error('NOPROFILE: No profile'));
|
|
||||||
|
|
||||||
profile = migratedProfile;
|
|
||||||
return root.bindProfile(profile, cb);
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
$log.debug('Profile read');
|
|
||||||
return root.bindProfile(profile, cb);
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
if (!profile) {
|
||||||
|
// Migration??
|
||||||
|
storageService.tryToMigrate(function(err, migratedProfile) {
|
||||||
|
if (err) return cb(err);
|
||||||
|
if (!migratedProfile)
|
||||||
|
return cb(new Error('NOPROFILE: No profile'));
|
||||||
|
|
||||||
|
profile = migratedProfile;
|
||||||
|
return root.bindProfile(profile, cb);
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
$log.debug('Profile read');
|
||||||
|
return root.bindProfile(profile, cb);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -276,8 +270,8 @@ angular.module('copayApp.services')
|
||||||
|
|
||||||
// check if exist
|
// check if exist
|
||||||
if (lodash.find(root.profile.credentials, {
|
if (lodash.find(root.profile.credentials, {
|
||||||
'walletId': walletData.walletId
|
'walletId': walletData.walletId
|
||||||
})) {
|
})) {
|
||||||
return cb(gettext('Cannot join the same wallet more that once'));
|
return cb(gettext('Cannot join the same wallet more that once'));
|
||||||
}
|
}
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
|
|
|
||||||
|
|
@ -199,14 +199,6 @@ angular.module('copayApp.services')
|
||||||
storage.remove('config', cb);
|
storage.remove('config', cb);
|
||||||
};
|
};
|
||||||
|
|
||||||
root.setCopayDisclaimerFlag = function(cb) {
|
|
||||||
storage.set('agreeDisclaimer', true, cb);
|
|
||||||
};
|
|
||||||
|
|
||||||
root.getCopayDisclaimerFlag = function(cb) {
|
|
||||||
storage.get('agreeDisclaimer', cb);
|
|
||||||
};
|
|
||||||
|
|
||||||
root.setRemotePrefsStoredFlag = function(cb) {
|
root.setRemotePrefsStoredFlag = function(cb) {
|
||||||
storage.set('remotePrefStored', true, cb);
|
storage.set('remotePrefStored', true, cb);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue