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

@ -32,6 +32,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
throw ('bad params');
}
$scope.isCordova = platformInfo.isCordova;
$scope.hasClick = platformInfo.hasClick;
$scope.data = {};
var config = configService.getSync().wallet;

View file

@ -983,7 +983,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
profileService.storeProfileIfDirty();
$log.debug('Profile loaded ... Starting UX.');
scannerService.gentleInitialize();
$state.go('tabs.home');
//$state.go('tabs.home');
}
});
});

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;
});

View file

@ -59,10 +59,10 @@
<i ng-show="!description" class="icon ion-ios-plus-empty size-21"></i>
</div>
</div>
<button class="button button-block button-positive" ng-click="approve()" ng-if="!isCordova" translate>Click to pay</button>
<button class="button button-block button-positive" ng-click="approve()" ng-if="hasClick" translate>Click to pay</button>
</ion-content>
<slide-to-accept
ng-if="isCordova || true"
ng-if="!hasClick"
slide-on-confirm="onConfirm()"
slide-send-status="sendStatus">
Slide to pay