added new logic to external link service to open in system browser with confirm message to notify them they're leaving and give option to cancel
This commit is contained in:
parent
6f3bd62efb
commit
f808a3afcd
15 changed files with 47 additions and 44 deletions
|
|
@ -6,7 +6,7 @@ angular.module('copayApp.controllers').controller('glideraController',
|
|||
$scope.network = glideraService.getEnvironment();
|
||||
|
||||
$scope.openExternalLink = function(url, target) {
|
||||
externalLinkService.open(url, target);
|
||||
externalLinkService.open(url);
|
||||
};
|
||||
|
||||
var initGlidera = function(accessToken) {
|
||||
|
|
@ -27,7 +27,9 @@ angular.module('copayApp.controllers').controller('glideraController',
|
|||
}
|
||||
$scope.token = glidera.token;
|
||||
$scope.permissions = glidera.permissions;
|
||||
$scope.update({fullUpdate: true});
|
||||
$scope.update({
|
||||
fullUpdate: true
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -113,7 +115,7 @@ angular.module('copayApp.controllers').controller('glideraController',
|
|||
});
|
||||
};
|
||||
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data){
|
||||
$scope.$on("$ionicView.beforeEnter", function(event, data) {
|
||||
initGlidera();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -971,8 +971,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
if (lodash.isEmpty(profileService.getWallets())) {
|
||||
$log.debug('No wallets and no disclaimer... redirecting');
|
||||
$state.go('onboarding.welcome');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$log.debug('Display disclaimer... redirecting');
|
||||
$state.go('onboarding.disclaimer', {
|
||||
resume: true
|
||||
|
|
@ -981,8 +980,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
} else {
|
||||
throw new Error(err); // TODO
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
profileService.storeProfileIfDirty();
|
||||
$log.debug('Profile loaded ... Starting UX.');
|
||||
scannerService.gentleInitialize();
|
||||
|
|
|
|||
|
|
@ -1,13 +1,17 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.services').service('externalLinkService', function(platformInfo, nodeWebkitService) {
|
||||
angular.module('copayApp.services').service('externalLinkService', function(platformInfo, nodeWebkitService, popupService, gettextCatalog) {
|
||||
|
||||
this.open = function(url, target) {
|
||||
this.open = function(url, desc) {
|
||||
if (platformInfo.isNW) {
|
||||
nodeWebkitService.openExternalLink(url);
|
||||
} else {
|
||||
target = target || '_blank';
|
||||
var ref = window.open(url, target, 'location=no');
|
||||
desc = desc || 'this link';
|
||||
var message = gettextCatalog.getString('You are leaving to view ' + desc + ''),
|
||||
openBrowser = function(res) {
|
||||
if (res) window.open(url, '_system');
|
||||
};
|
||||
popupService.showConfirm('Opening Browser', message, 'Open', 'Cancel', openBrowser);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue