fix url handling on cold start
This commit is contained in:
parent
e28a4fb2ad
commit
27e925b84f
3 changed files with 12 additions and 9 deletions
|
|
@ -518,7 +518,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
|||
}
|
||||
});
|
||||
})
|
||||
.run(function($rootScope, $state, $location, $log, $timeout, $ionicPlatform, platformInfo, profileService, uxLanguage, animationService, go, gettextCatalog) {
|
||||
.run(function($rootScope, $state, $location, $log, $timeout, $ionicPlatform, platformInfo, profileService, uxLanguage, go, gettextCatalog) {
|
||||
|
||||
$ionicPlatform.ready(function() {
|
||||
if (platformInfo.isCordova) {
|
||||
|
|
|
|||
|
|
@ -24,9 +24,12 @@ angular.module('copayApp.services').factory('openURLService', function($rootScop
|
|||
if (!profileService.isBound) {
|
||||
$log.warn('Profile not bound yet. Waiting');
|
||||
|
||||
return $rootScope.$on('Local/ProfileBound', function(){
|
||||
$log.warn('Profile ready, retrying...');
|
||||
handleOpenURL(args);
|
||||
return $rootScope.$on('Local/ProfileBound', function() {
|
||||
// Wait ux to settle
|
||||
setTimeout(function() {
|
||||
$log.warn('Profile ready, retrying...');
|
||||
handleOpenURL(args);
|
||||
}, 2000);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -53,10 +56,10 @@ angular.module('copayApp.services').factory('openURLService', function($rootScop
|
|||
document.addEventListener('handleopenurl', handleOpenURL, false);
|
||||
|
||||
var x = lodash.find(root.registeredUriHandlers, function(x) {
|
||||
return url.indexOf(x.startsWith) == 0 ||
|
||||
url.indexOf('web+' + x.startsWith) == 0 || // web protocols
|
||||
url.indexOf(x.startsWith.replace(':','://')) == 0 // from mobile devices
|
||||
;
|
||||
return url.indexOf(x.startsWith) == 0 ||
|
||||
url.indexOf('web+' + x.startsWith) == 0 || // web protocols
|
||||
url.indexOf(x.startsWith.replace(':', '://')) == 0 // from mobile devices
|
||||
;
|
||||
});
|
||||
|
||||
if (x) {
|
||||
|
|
|
|||
|
|
@ -171,7 +171,7 @@ angular.module('copayApp.services')
|
|||
}
|
||||
|
||||
root.isBound = true;
|
||||
$root.$emit('Local/ProfileBound');
|
||||
$rootScope.$emit('Local/ProfileBound');
|
||||
return cb();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue