use defaults config values

This commit is contained in:
Gabriel Bazán 2016-11-18 16:30:57 -03:00
parent b665922e7a
commit 787924fc06
1 changed files with 14 additions and 14 deletions

View File

@ -2,47 +2,47 @@
angular.module('copayApp.controllers').controller('completeController', function($scope, $stateParams, $timeout, $log, $ionicHistory, $state, $ionicNavBarDelegate, $ionicConfig, platformInfo, configService, storageService, lodash) {
$scope.isCordova = platformInfo.isCordova;
var config = configService.getSync();
var defaults = configService.getDefaults();
function quickFeedback(cb){
function quickFeedback(cb) {
window.plugins.spinnerDialog.show();
$timeout(window.plugins.spinnerDialog.hide, 300);
$timeout(cb, 20);
}
$scope.shareFacebook = function() {
quickFeedback(function(){
window.plugins.socialsharing.shareVia($scope.shareFacebookVia, null, null, null, config.download.url);
quickFeedback(function() {
window.plugins.socialsharing.shareVia($scope.shareFacebookVia, null, null, null, defaults.download.url);
});
};
$scope.shareTwitter = function() {
quickFeedback(function(){
window.plugins.socialsharing.shareVia($scope.shareTwitterVia, null, null, null, config.download.url);
quickFeedback(function() {
window.plugins.socialsharing.shareVia($scope.shareTwitterVia, null, null, null, defaults.download.url);
});
};
$scope.shareGooglePlus = function() {
quickFeedback(function(){
window.plugins.socialsharing.shareVia($scope.shareGooglePlusVia, config.download.url);
quickFeedback(function() {
window.plugins.socialsharing.shareVia($scope.shareGooglePlusVia, defaults.download.url);
});
};
$scope.shareEmail = function() {
quickFeedback(function(){
window.plugins.socialsharing.shareViaEmail(config.download.url);
quickFeedback(function() {
window.plugins.socialsharing.shareViaEmail(defaults.download.url);
});
};
$scope.shareWhatsapp = function() {
quickFeedback(function(){
window.plugins.socialsharing.shareViaWhatsApp(config.download.url);
quickFeedback(function() {
window.plugins.socialsharing.shareViaWhatsApp(defaults.download.url);
});
};
$scope.shareMessage = function() {
quickFeedback(function(){
window.plugins.socialsharing.shareViaSMS(config.download.url);
quickFeedback(function() {
window.plugins.socialsharing.shareViaSMS(defaults.download.url);
});
};