Wallet/src/js/controllers/disclaimer.js

39 lines
1.1 KiB
JavaScript
Raw Normal View History

'use strict';
angular.module('copayApp.controllers').controller('disclaimerController',
2015-11-17 11:10:09 -03:00
function($scope, $timeout, $log, profileService, isCordova, storageService, gettextCatalog, applicationService, uxLanguage, go) {
2015-11-17 11:10:09 -03:00
$scope.create = function() {
$scope.creatingProfile = true;
if (isCordova) {
window.plugins.spinnerDialog.show(null, gettextCatalog.getString('Loading...'), true);
}
$scope.loading = true;
2015-11-17 11:10:09 -03:00
storageService.setCopayDisclaimerFlag(function(err) {
$scope.creatingProfile = false;
if (isCordova) {
window.plugins.spinnerDialog.hide();
}
applicationService.restart();
});
};
2015-11-17 11:10:09 -03:00
$scope.init = function(noWallet) {
storageService.getCopayDisclaimerFlag(function(err, val) {
2015-09-18 01:03:22 +09:00
$scope.lang = uxLanguage.currentLanguage;
$scope.agreed = val;
2015-11-17 11:10:09 -03:00
profileService.create({
noWallet: noWallet
}, function(err) {
if (err) {
$log.warn(err);
$scope.error = err;
$scope.$apply();
}
});
});
};
2015-11-17 11:10:09 -03:00
});