2015-04-25 12:37:04 -03:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
angular.module('copayApp.controllers').controller('preferencesLogs',
|
2016-12-12 17:29:11 -03:00
|
|
|
function($scope, historicLog) {
|
2015-04-25 21:08:19 -03:00
|
|
|
|
2016-09-23 12:42:33 -03:00
|
|
|
$scope.$on("$ionicView.enter", function(event, data) {
|
|
|
|
|
$scope.logs = historicLog.get();
|
2016-08-15 17:42:04 -03:00
|
|
|
|
2016-09-23 12:42:33 -03:00
|
|
|
$scope.prepare = function() {
|
|
|
|
|
var log = 'Copay Session Logs\n Be careful, this could contain sensitive private data\n\n';
|
|
|
|
|
log += '\n\n';
|
|
|
|
|
log += $scope.logs.map(function(v) {
|
|
|
|
|
return v.msg;
|
|
|
|
|
}).join('\n');
|
2016-09-05 14:59:11 -03:00
|
|
|
|
2016-09-23 12:42:33 -03:00
|
|
|
return log;
|
|
|
|
|
};
|
2016-09-05 14:59:11 -03:00
|
|
|
|
2016-09-23 12:42:33 -03:00
|
|
|
$scope.sendLogs = function() {
|
|
|
|
|
var body = $scope.prepare();
|
|
|
|
|
|
|
|
|
|
window.plugins.socialsharing.shareViaEmail(
|
|
|
|
|
body,
|
|
|
|
|
'Copay Logs',
|
|
|
|
|
null, // TO: must be null or an array
|
|
|
|
|
null, // CC: must be null or an array
|
|
|
|
|
null, // BCC: must be null or an array
|
|
|
|
|
null, // FILES: can be null, a string, or an array
|
|
|
|
|
function() {},
|
|
|
|
|
function() {}
|
|
|
|
|
);
|
|
|
|
|
};
|
2016-09-22 11:55:23 -03:00
|
|
|
|
|
|
|
|
});
|
2016-08-15 17:42:04 -03:00
|
|
|
});
|