More copy and share for mobile
This commit is contained in:
parent
04fe842b61
commit
79db8cea2e
11 changed files with 69 additions and 26 deletions
|
|
@ -1,12 +1,13 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('CopayersController',
|
||||
function($scope, $rootScope, $timeout, go, identityService, notification) {
|
||||
function($scope, $rootScope, $timeout, go, identityService, notification, isCordova) {
|
||||
var w = $rootScope.wallet;
|
||||
$scope.init = function() {
|
||||
$rootScope.title = 'Share this secret with your copayers';
|
||||
$scope.loading = false;
|
||||
$scope.secret = $rootScope.wallet.getSecret();
|
||||
$scope.isCordova = isCordova;
|
||||
|
||||
w.on('publicKeyRingUpdated', $scope.updateList);
|
||||
w.on('ready', $scope.updateList);
|
||||
|
|
@ -48,4 +49,20 @@ angular.module('copayApp.controllers').controller('CopayersController',
|
|||
});
|
||||
};
|
||||
|
||||
$scope.copySecret = function(secret) {
|
||||
if (isCordova) {
|
||||
window.cordova.plugins.clipboard.copy(secret);
|
||||
window.plugins.toast.showShortCenter('Copied to clipboard');
|
||||
}
|
||||
};
|
||||
|
||||
$scope.shareSecret = function(secret) {
|
||||
if (isCordova) {
|
||||
if (isMobile.Android() || isMobile.Windows()) {
|
||||
window.ignoreMobilePause = true;
|
||||
}
|
||||
window.plugins.socialsharing.share(secret, null, null, null);
|
||||
}
|
||||
};
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue