Merge pull request #1868 from cmgustavo/bug/uri-handler
Bug/uri handler
This commit is contained in:
commit
82bfa7d855
3 changed files with 4 additions and 5 deletions
|
|
@ -104,9 +104,10 @@ angular
|
||||||
$idleProvider.warningDuration(40); // in seconds
|
$idleProvider.warningDuration(40); // in seconds
|
||||||
$keepaliveProvider.interval(30); // in seconds
|
$keepaliveProvider.interval(30); // in seconds
|
||||||
})
|
})
|
||||||
.run(function($rootScope, $location, $idle, gettextCatalog) {
|
.run(function($rootScope, $location, $idle, gettextCatalog, uriHandler) {
|
||||||
gettextCatalog.currentLanguage = config.defaultLanguage;
|
gettextCatalog.currentLanguage = config.defaultLanguage;
|
||||||
$idle.watch();
|
$idle.watch();
|
||||||
|
uriHandler.register();
|
||||||
$rootScope.$on('$routeChangeStart', function(event, next, current) {
|
$rootScope.$on('$routeChangeStart', function(event, next, current) {
|
||||||
if (!localStorage || localStorage.length < 1) {
|
if (!localStorage || localStorage.length < 1) {
|
||||||
$location.path('unsupported');
|
$location.path('unsupported');
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
var bitcore = require('bitcore');
|
var bitcore = require('bitcore');
|
||||||
|
|
||||||
angular.module('copayApp.services')
|
angular.module('copayApp.services')
|
||||||
.factory('controllerUtils', function($rootScope, $sce, $location, $filter, notification, $timeout, uriHandler, rateService) {
|
.factory('controllerUtils', function($rootScope, $sce, $location, $filter, notification, $timeout, rateService) {
|
||||||
var root = {};
|
var root = {};
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -182,7 +182,6 @@ angular.module('copayApp.services')
|
||||||
|
|
||||||
root.setupGlobalVariables = function(iden) {
|
root.setupGlobalVariables = function(iden) {
|
||||||
notification.enableHtml5Mode(); // for chrome: if support, enable it
|
notification.enableHtml5Mode(); // for chrome: if support, enable it
|
||||||
uriHandler.register();
|
|
||||||
$rootScope.unitName = config.unitName;
|
$rootScope.unitName = config.unitName;
|
||||||
$rootScope.pendingTxCount = 0;
|
$rootScope.pendingTxCount = 0;
|
||||||
$rootScope.initialConnection = true;
|
$rootScope.initialConnection = true;
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,7 @@ UriHandler.prototype.register = function() {
|
||||||
var base = window.location.origin + '/';
|
var base = window.location.origin + '/';
|
||||||
var url = base + '#!/uri-payment/%s';
|
var url = base + '#!/uri-payment/%s';
|
||||||
|
|
||||||
var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
|
if(navigator.registerProtocolHandler) {
|
||||||
if(navigator.registerProtocolHandler && !isFirefox) {
|
|
||||||
navigator.registerProtocolHandler('bitcoin', url, 'Copay');
|
navigator.registerProtocolHandler('bitcoin', url, 'Copay');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue