Konsumierung fehlerfrei implementiert
This commit is contained in:
parent
38583577f6
commit
40f83058b2
@ -34,7 +34,7 @@ $scope.show = function() {
|
|||||||
|
|
||||||
|
|
||||||
function successBuyHandler (result) {
|
function successBuyHandler (result) {
|
||||||
$timeout(consumesuccessHandler, 1000);
|
$timeout(consumesuccessHandler, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
function successConsumeHandler (result) {
|
function successConsumeHandler (result) {
|
||||||
@ -100,18 +100,22 @@ $scope.show = function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function errorBuyHandler (error) {
|
function errorBuyHandler (error) {
|
||||||
/*
|
|
||||||
var strResult = "";
|
var strResult = "";
|
||||||
|
var returnBool=false;
|
||||||
if(typeof error === 'object') {
|
if(typeof error === 'object') {
|
||||||
strResult = JSON.stringify(error);
|
strResult = JSON.stringify(error);
|
||||||
} else {
|
} else {
|
||||||
strResult = error;
|
strResult = error;
|
||||||
}
|
}
|
||||||
alert("Feher: \r\n"+strResult );
|
returnBool=strResult.indexOf("Item Already Owned") != -1;
|
||||||
*/
|
|
||||||
|
|
||||||
|
if (returnBool==true){
|
||||||
var alertPopup = $ionicPopup.alert({
|
//alert("Schon gekauft");
|
||||||
|
$timeout(consumesuccessHandler, 500);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
var alertPopup = $ionicPopup.alert({
|
||||||
title: 'Oh Nein',
|
title: 'Oh Nein',
|
||||||
template: 'Der Kauf konnte nicht durchgeführt werden.'
|
template: 'Der Kauf konnte nicht durchgeführt werden.'
|
||||||
});
|
});
|
||||||
@ -119,6 +123,8 @@ $scope.show = function() {
|
|||||||
alertPopup.then(function(res) {
|
alertPopup.then(function(res) {
|
||||||
console.log('Der Kauf konnte nicht durchgeführt werden');
|
console.log('Der Kauf konnte nicht durchgeführt werden');
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function errorConsumeHandler (error) {
|
function errorConsumeHandler (error) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user