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,18 +100,22 @@ $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;
var alertPopup = $ionicPopup.alert({
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.'
});
@ -119,6 +123,8 @@ $scope.show = function() {
alertPopup.then(function(res) {
console.log('Der Kauf konnte nicht durchgeführt werden');
});
}
}
function errorConsumeHandler (error) {