error alert

This commit is contained in:
CHIEFSOFT\ameye
2023-10-14 15:54:09 -04:00
parent 77cf17ffad
commit da207bdf27
+18 -5
View File
@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import {NavController} from "@ionic/angular";
import {AlertController, NavController} from "@ionic/angular";
import {Router} from "@angular/router";
import {SessionDataProviderService} from "../../store/session-data-provider.service";
import {WrenchService} from "../../services/wrench.service";
@@ -53,7 +53,8 @@ wallet_uid
private navctr: NavController,
private router: Router,
public sessionDataProviderService: SessionDataProviderService,
private wrenchService: WrenchService
private wrenchService: WrenchService,
private alertController: AlertController
) {
this.walletData = this.router.getCurrentNavigation().extras.state;
if ( this.walletData != undefined ){
@@ -163,16 +164,19 @@ array (size=4)
recipient_uid:string = '';
contineRedeem(){
if (this.recipient == ''){
alert("Select Recipient");
//alert("Select Recipient");
this.showAlert("Error","Select Recipient");
return;
}
if (this.amount <= 0 ) {
alert("Enter Amount");
this.showAlert("Error","Enter valid Amount");
//alert("Enter Amount");
return;
}
if (this.curr_balance < this.total){
alert("Enter Amount less than your wallet");
this.showAlert("Error","Enter Amount less than your wallet");
//alert("Enter Amount less than your wallet");
return;
}
@@ -184,7 +188,16 @@ array (size=4)
}
}
async showAlert(mtitle: string, amessage: string) {
const alert = await this.alertController.create({
header: 'WrenchBoard',
subHeader: mtitle,
message: amessage,
buttons: ['OK'],
});
await alert.present();
}
/*
{