Wallet/src/js/controllers/preferencesLogs.js

34 lines
929 B
JavaScript
Raw Normal View History

2015-04-25 12:37:04 -03:00
'use strict';
angular.module('copayApp.controllers').controller('preferencesLogs',
function($scope, historicLog, gettextCatalog) {
2015-04-25 21:08:19 -03:00
2016-09-05 14:59:11 -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) {
2016-08-15 17:42:04 -03:00
return v.msg;
}).join('\n');
2016-09-05 14:59:11 -03:00
return log;
};
$scope.sendLogs = function() {
var body = $scope.prepare();
2016-08-15 17:42:04 -03:00
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() {}
);
};
$scope.$on("$ionicView.enter", function(event, data){
$scope.logs = historicLog.get();
});
2016-08-15 17:42:04 -03:00
});