Konsumierung fehlerfrei implementiert

This commit is contained in:
Carsten Hilmer 2016-02-01 21:48:29 +01:00
parent 38583577f6
commit 40f83058b2

View File

@ -34,7 +34,7 @@ $scope.show = function() {
function successBuyHandler (result) {
$timeout(consumesuccessHandler, 1000);
$timeout(consumesuccessHandler, 500);
}
function successConsumeHandler (result) {
@ -100,17 +100,21 @@ $scope.show = function() {
}
function errorBuyHandler (error) {
/*
var strResult = "";
var returnBool=false;
if(typeof error === 'object') {
strResult = JSON.stringify(error);
} else {
strResult = error;
}
alert("Feher: \r\n"+strResult );
*/
returnBool=strResult.indexOf("Item Already Owned") != -1;
if (returnBool==true){
//alert("Schon gekauft");
$timeout(consumesuccessHandler, 500);
}
else{
var alertPopup = $ionicPopup.alert({
title: 'Oh Nein',
template: 'Der Kauf konnte nicht durchgeführt werden.'
@ -121,6 +125,8 @@ $scope.show = function() {
});
}
}
function errorConsumeHandler (error) {
var alertPopup = $ionicPopup.alert({
title: 'Oh Nein',