change entrys, url and add feedback service

This commit is contained in:
Gabriel Bazán 2016-11-09 12:09:22 -03:00
commit 2284e2507f
4 changed files with 46 additions and 25 deletions

View file

@ -25,6 +25,9 @@ angular.module('copayApp.services').factory('configService', function(storageSer
wp: ''
},
feedback: {
url: 'https://script.google.com/macros/s/AKfycbybtvNSQKUfgzgXcj3jYLlvCKrcBoktjiJ1V8_cwd2yVkpUBGe3/exec'
},
// wallet default config
wallet: {
requiredCopayers: 2,

View file

@ -0,0 +1,29 @@
'use strict';
angular.module('copayApp.services').factory('feedbackService', function($http, $log, $httpParamSerializer, configService) {
var root = {};
root.send = function(dataSrc, cb) {
$http(_post(dataSrc)).then(function() {
$log.info("SUCCESS: Feedback sent");
return cb();
}, function(err) {
$log.info("ERROR: Feedback sent anyway.");
return cb(err);
});
};
var _post = function(dataSrc) {
var config = configService.getSync();
var url = config.feedback.url;
return {
method: 'POST',
url: url,
headers: {
'content-type': 'application/x-www-form-urlencoded; charset=UTF-8'
},
data: $httpParamSerializer(dataSrc)
};
};
return root;
});

View file

@ -33,6 +33,7 @@ angular.module('copayApp.services').factory('ongoingProcess', function($log, $ti
'validatingWallet': gettext('Validating wallet integrity...'),
'validatingWords': gettext('Validating recovery phrase...'),
'loadingTxInfo': gettext('Loading transaction info...'),
'sendingFeedback': gettext('Sending feedback...'),
};
root.clear = function() {
@ -64,7 +65,7 @@ angular.module('copayApp.services').factory('ongoingProcess', function($log, $ti
var showName = $filter('translate')(processNames[name] || name);
if(customHandler) {
if (customHandler) {
customHandler(processName, showName, isOn);
} else if (root.onGoingProcessName) {
if (isCordova) {