add hasClick to platformInfo and use it to determine whether to show the slide to pay component or not

This commit is contained in:
Marty Alcala 2016-10-10 14:22:00 -04:00
commit a1c73b7148
4 changed files with 20 additions and 3 deletions

View file

@ -39,5 +39,21 @@ angular.module('copayApp.services').factory('platformInfo', function($window) {
ret.isChromeApp = $window.chrome && chrome.runtime && chrome.runtime.id && !ret.isNW;
ret.isDevel = !ret.isMobile && !ret.isChromeApp && !ret.isNW;
ret.hasClick = false;
if($window.sessionStorage.getItem('hasClick')) {
ret.hasClick = true;
}
$window.addEventListener('mousedown', function() {
ret.hasClick = true;
$window.sessionStorage.setItem('hasClick', 'true');
});
$window.addEventListener('touchstart', function() {
ret.hasClick = false;
$window.sessionStorage.removeItem('hasClick');
});
return ret;
});