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() {
|
$ionicPlatform.ready(function() {
|
||||||
if (platformInfo.isCordova) {
|
if (platformInfo.isCordova) {
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,12 @@ angular.module('copayApp.services').factory('openURLService', function($rootScop
|
||||||
if (!profileService.isBound) {
|
if (!profileService.isBound) {
|
||||||
$log.warn('Profile not bound yet. Waiting');
|
$log.warn('Profile not bound yet. Waiting');
|
||||||
|
|
||||||
return $rootScope.$on('Local/ProfileBound', function(){
|
return $rootScope.$on('Local/ProfileBound', function() {
|
||||||
$log.warn('Profile ready, retrying...');
|
// Wait ux to settle
|
||||||
handleOpenURL(args);
|
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);
|
document.addEventListener('handleopenurl', handleOpenURL, false);
|
||||||
|
|
||||||
var x = lodash.find(root.registeredUriHandlers, function(x) {
|
var x = lodash.find(root.registeredUriHandlers, function(x) {
|
||||||
return url.indexOf(x.startsWith) == 0 ||
|
return url.indexOf(x.startsWith) == 0 ||
|
||||||
url.indexOf('web+' + x.startsWith) == 0 || // web protocols
|
url.indexOf('web+' + x.startsWith) == 0 || // web protocols
|
||||||
url.indexOf(x.startsWith.replace(':','://')) == 0 // from mobile devices
|
url.indexOf(x.startsWith.replace(':', '://')) == 0 // from mobile devices
|
||||||
;
|
;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (x) {
|
if (x) {
|
||||||
|
|
|
||||||
|
|
@ -171,7 +171,7 @@ angular.module('copayApp.services')
|
||||||
}
|
}
|
||||||
|
|
||||||
root.isBound = true;
|
root.isBound = true;
|
||||||
$root.$emit('Local/ProfileBound');
|
$rootScope.$emit('Local/ProfileBound');
|
||||||
return cb();
|
return cb();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue