import on splash

This commit is contained in:
Matias Alejo Garcia 2015-05-13 11:58:19 -03:00
commit 51ad7d83dc
12 changed files with 28 additions and 52 deletions

View file

@ -29,13 +29,6 @@
<span translate>Import wallet </span> <span translate>Import wallet </span>
</a> </a>
</li> </li>
<li>
<a title="Import wallet" ng-click="$root.go('importLegacy')">
<i class="fi-archive plus-fixed circle"></i>
<i class="icon-arrow-right3 size-18 right m20t"></i>
<span translate>Import from Copay Beta 0.9</span>
</a>
</li>
</ul> </ul>
</div> </div>

View file

@ -54,6 +54,12 @@
Import backup Import backup
</button> </button>
</form> </form>
<a class="m20t button outline light-gray expand" ng-click="$root.go('importLegacy')" translate>
Importing Backup from Copay v0.9? Click here
</a>
</div> </div>
</div> </div>
</div> </div>

View file

@ -1,18 +1,13 @@
<div <div
class="topbar-container" class="topbar-container"
ng-include="'views/includes/topbar.html'" ng-include="'views/includes/topbar.html'"
ng-init="titleSection='Import legacy wallet'; goBackToState = 'add'; noColor = true"> ng-init="titleSection='Import legacy wallet'; goBackToState = 'import'; noColor = true">
</div> </div>
<div class="content p20v" ng-controller="importLegacyController as importLegacy"> <div class="content p20v" ng-controller="importLegacyController as importLegacy">
<div class="row m20t"> <div class="row m20t">
<div class="large-5 large-centered medium-7 medium-centered columns">
<div class="logo-setup show-for-large-up">
<img src="img/logo-negative.svg" alt="Copay" width="100">
<div ng-include="'views/includes/version.html'"></div>
</div>
<div> <div>
<div ng-show="importLegacy.importing"> <div ng-show="importLegacy.importing">
<h1 class="m20b animated infinite flash" translate>Importing...</h1> <h1 class="m20b animated infinite flash" translate>Importing...</h1>
@ -78,6 +73,5 @@
</div> </div>
</div>
</div> </div>

View file

@ -22,10 +22,12 @@
<div class="rect4"></div> <div class="rect4"></div>
<div class="rect5"></div> <div class="rect5"></div>
</div> </div>
<span translate>Creating Wallet...</span> <span translate>Creating Profile...</span>
</div> </div>
</div> </div>
<div class="row columns start-button" ng-show="!creatingProfile"> <div class="row columns start-button" ng-show="!creatingProfile">
<button ng-click="create()" class="button black expand radius size-12 text-spacing" translate> GET STARTED </button> <button ng-click="create()" class="button black expand radius size-12 text-spacing" translate> GET STARTED </button>
<p class="text-gray m5b size-12" translate>Already have a wallet?</p>
<button ng-click="create(true)" class="outline dark-gray tiny" translate>Import backup </button>
</div> </div>
</div> </div>

View file

@ -1,3 +0,0 @@
<div class="tour">
<img ng-click="$root.go('splash.four')" class="m15t" src="img/tour2.png" alt="tour1" width="90%">
</div>

View file

@ -1,3 +0,0 @@
<div class="tour">
<img ng-click="$root.go('splash.four')" class="m15t" src="img/tour3.png" alt="tour1" width="90%">
</div>

View file

@ -1,3 +0,0 @@
<div class="tour">
<img ng-click="$root.go('walletHome')" class="m15t" src="img/tour4.png" alt="tour1" width="90%">
</div>

View file

@ -1,15 +0,0 @@
<div class="tour">
<img ng-click="$root.go('splash.finish')" class="m15t" src="img/tour5.png" alt="tour1" width="90%">
</div>
<div class="row tour5">
<div class="small-6 columns">
<button class="button outline light-gray radius expand">
SKIP
</button>
</div>
<div class="small-6 columns">
<button class="black radius expand">
SET A PIN
</button>
</div>
</div>

View file

@ -721,7 +721,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.noFocusedWallet = true; self.noFocusedWallet = true;
self.isComplete = null; self.isComplete = null;
self.walletName = null; self.walletName = null;
go.addWallet(); go.path('import');
}); });
}); });

View file

@ -14,17 +14,20 @@ Profile.create = function(opts) {
var x = new Profile(); var x = new Profile();
x.createdOn = Date.now(); x.createdOn = Date.now();
x.credentials = opts.credentials; x.credentials = opts.credentials || [];
return x; return x;
}; };
Profile.fromObj = function(obj) { Profile.fromObj = function(obj) {
var x = new Profile(); var x = new Profile();
x.createdOn = obj.createdOn; x.createdOn = obj.createdOn;
x.credentials = obj.credentials; x.credentials = obj.credentials;
if (x.credentials[0] && typeof x.credentials[0] != 'object') if (x.credentials[0] && typeof x.credentials[0] != 'object')
throw ("credentials should be an object"); throw ("credentials should be an object");
return x; return x;
}; };

View file

@ -68,23 +68,23 @@ angular
needProfile: false, needProfile: false,
views: { views: {
'main': { 'main': {
templateUrl: 'views/splash/1.html', templateUrl: 'views/splash.html',
controller: function($scope, $timeout, $log, profileService, go) { controller: function($scope, $timeout, $log, profileService, go) {
if (profileService.profile) { if (profileService.profile) {
go.walletHome(); go.walletHome();
} }
$scope.create = function() { $scope.create = function(noWallet) {
$scope.creatingProfile = true; $scope.creatingProfile = true;
profileService.create(function(err) { profileService.create({noWallet: noWallet}, function(err) {
if (err) { if (err) {
$scope.creatingProfile = false; $scope.creatingProfile = false;
$log.warn(err); $log.warn(err);
$scope.error = err; $scope.error = err;
$scope.$apply(); $scope.$apply();
$timeout(function() { $timeout(function() {
$scope.create(); $scope.create(noWallet);
}, 3000); }, 3000);
} }
}); });
@ -384,7 +384,7 @@ angular
create: 12, create: 12,
join: 12, join: 12,
import: 12, import: 12,
importLegacy: 12 importLegacy: 13
}; };

View file

@ -157,9 +157,13 @@ angular.module('copayApp.services')
}); });
}; };
root._createNewProfile = function(cb) { root._createNewProfile = function(opts, cb) {
var walletClient = bwcService.getClient();
if (opts.noWallet) {
return cb(null, Profile.create());
}
var walletClient = bwcService.getClient();
walletClient.createWallet('Personal Wallet', 'me', 1, 1, { walletClient.createWallet('Personal Wallet', 'me', 1, 1, {
network: 'livenet' network: 'livenet'
}, function(err) { }, function(err) {
@ -276,13 +280,11 @@ angular.module('copayApp.services')
}); });
}; };
root.create = function(opts, cb) {
root.create = function(cb) {
$log.info('Creating profile'); $log.info('Creating profile');
configService.get(function(err) { configService.get(function(err) {
root.applyConfig(); root.applyConfig();
root._createNewProfile(function(err, p) { root._createNewProfile(opts, function(err, p) {
if (err) return cb(err); if (err) return cb(err);
root.bindProfile(p, function(err) { root.bindProfile(p, function(err) {