diff --git a/btc-UI/src/app/components/sidebar/sidebar.component.css b/btc-UI/src/app/components/sidebar/sidebar.component.css
index 06a56af..28220da 100755
--- a/btc-UI/src/app/components/sidebar/sidebar.component.css
+++ b/btc-UI/src/app/components/sidebar/sidebar.component.css
@@ -528,4 +528,9 @@ h4{
strong{
padding-left: 2rem;
margin-top: 2rem;
+}
+
+.modal-loading{
+ color: red;
+ font-weight: bold;
}
\ No newline at end of file
diff --git a/btc-UI/src/app/components/sidebar/sidebar.component.html b/btc-UI/src/app/components/sidebar/sidebar.component.html
index 1b3839f..c3a152f 100755
--- a/btc-UI/src/app/components/sidebar/sidebar.component.html
+++ b/btc-UI/src/app/components/sidebar/sidebar.component.html
@@ -39,12 +39,19 @@
VIEW RC
diff --git a/btc-UI/src/app/components/sidebar/sidebar.component.ts b/btc-UI/src/app/components/sidebar/sidebar.component.ts
index 8093801..2778b8e 100755
--- a/btc-UI/src/app/components/sidebar/sidebar.component.ts
+++ b/btc-UI/src/app/components/sidebar/sidebar.component.ts
@@ -38,6 +38,8 @@ export class SidebarComponent {
balanceWithdraw: number = 0;
balanceDeposit: number = 0;
+ loadingMessage: string = '';
+
// Modal handlers...
openCancelPopup() {
this.cancelClick.emit();
@@ -66,6 +68,7 @@ export class SidebarComponent {
}
+
//--------------------------------------- UPDATED CANCEL PRINT -------------------------------------------
cancelWarning: string = ''; // For showing inline warnings
@@ -118,9 +121,13 @@ updateAllBalances() {
async printTicketCancel() {
+
+ this.cancelWarning = "Requested please wait";
const enteredTicketNo = this.ticketNo?.trim();
console.log('[STEP 1] Entered Ticket No:', enteredTicketNo);
this.cancelWarning = '';
+ this.loadingMessage = 'Printing cancel ticket β please wait...';
+
const localTicketsStr = localStorage.getItem('canceltickets');
if (!localTicketsStr) {
@@ -166,7 +173,7 @@ async printTicketCancel() {
this.btid = localStorage.getItem('btid');
this.usrid = localStorage.getItem('userid');
const userid = this.usrid ;
- const btmake = 'I' ;
+ const btMake = 'I'
console.log("empl id", this.usrid)
try {
@@ -174,7 +181,7 @@ async printTicketCancel() {
ticketNo: lastTicket.barcodeId,
btId: this.btid,
usrId: userid,
- btMake: btmake
+ btMake: btMake
};
console.log("π‘ Sending cancel request:", cancelReq);
@@ -255,6 +262,9 @@ Original Total: βΉ${cancelTicketData.totalAmount}
console.error("β Cancel API call failed:", e);
this.cancelWarning = 'β Cancel API call failed. Please try again.';
}
+ finally {
+ this.loadingMessage = ''; // ALWAYS clear loading message
+ }
}
//-------------------------------- COMPLETED THE CANCEL PRINT WITH API CALL --------------------------------
@@ -283,7 +293,7 @@ payoutWarning = ''; // show GUI message when payout response is not as expected
async printPayoutTicket() {
console.log("π¨οΈ Print payout clicked");
this.payoutWarning = '';
-
+ this.loadingMessage = 'Printing cancel ticket β please wait...';
const ticketNo = this.payoutTicketNo?.toString().trim();
if (!ticketNo) {
console.warn("β οΈ No payout ticket number set.");
@@ -294,9 +304,8 @@ async printPayoutTicket() {
const userName = localStorage.getItem('userName') || 'Unknown';
this.btid = localStorage.getItem('btid');
this.usrid = localStorage.getItem('userid');
- const userid = this.usrid ;
- console.log("empl id", this.usrid)
- const btmake = 'I' ;
+ const userid = this.usrid ;
+ const btMake = 'I'
// Prepare request payload
const apiPayload = {
ticketNo: ticketNo,
@@ -306,7 +315,7 @@ async printPayoutTicket() {
moneyTyp: "C",
btId: this.btid, // replace with dynamic btId if needed
usrId: userid , // replace with dynamic usrId if needed
- btMake: btmake
+ btMake: btMake
};
console.log("π‘ Sending payout API request:", apiPayload);
@@ -409,6 +418,9 @@ Date : ${new Date().toLocaleString()}
} catch (err) {
console.error("β Payout API call failed:", err);
this.payoutWarning = 'β Payout API call failed. Please try again.';
+ }
+ finally {
+ this.loadingMessage = ''; // ALWAYS clear loading message
}
}