add hasClick to platformInfo and use it to determine whether to show the slide to pay component or not
This commit is contained in:
parent
b9ba2af993
commit
a1c73b7148
4 changed files with 20 additions and 3 deletions
|
|
@ -32,6 +32,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
|
||||||
throw ('bad params');
|
throw ('bad params');
|
||||||
}
|
}
|
||||||
$scope.isCordova = platformInfo.isCordova;
|
$scope.isCordova = platformInfo.isCordova;
|
||||||
|
$scope.hasClick = platformInfo.hasClick;
|
||||||
$scope.data = {};
|
$scope.data = {};
|
||||||
|
|
||||||
var config = configService.getSync().wallet;
|
var config = configService.getSync().wallet;
|
||||||
|
|
|
||||||
|
|
@ -983,7 +983,7 @@ angular.module('copayApp').config(function(historicLogProvider, $provide, $logPr
|
||||||
profileService.storeProfileIfDirty();
|
profileService.storeProfileIfDirty();
|
||||||
$log.debug('Profile loaded ... Starting UX.');
|
$log.debug('Profile loaded ... Starting UX.');
|
||||||
scannerService.gentleInitialize();
|
scannerService.gentleInitialize();
|
||||||
$state.go('tabs.home');
|
//$state.go('tabs.home');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -39,5 +39,21 @@ angular.module('copayApp.services').factory('platformInfo', function($window) {
|
||||||
ret.isChromeApp = $window.chrome && chrome.runtime && chrome.runtime.id && !ret.isNW;
|
ret.isChromeApp = $window.chrome && chrome.runtime && chrome.runtime.id && !ret.isNW;
|
||||||
ret.isDevel = !ret.isMobile && !ret.isChromeApp && !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;
|
return ret;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -59,10 +59,10 @@
|
||||||
<i ng-show="!description" class="icon ion-ios-plus-empty size-21"></i>
|
<i ng-show="!description" class="icon ion-ios-plus-empty size-21"></i>
|
||||||
</div>
|
</div>
|
||||||
</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>
|
</ion-content>
|
||||||
<slide-to-accept
|
<slide-to-accept
|
||||||
ng-if="isCordova || true"
|
ng-if="!hasClick"
|
||||||
slide-on-confirm="onConfirm()"
|
slide-on-confirm="onConfirm()"
|
||||||
slide-send-status="sendStatus">
|
slide-send-status="sendStatus">
|
||||||
Slide to pay
|
Slide to pay
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue