async checkAddressQuote(bool?) {
try {
this.checkSenderAddress = await this.getCheckSenderAddress(bool);
this.checkShipToAddress = await this.getCheckShipToAddress(bool);
this.checkPackageValidation = await this.getCheckPackageValidation(bool);
}catch(e){
}
}
/**
* @description: async check
* @param {*}
* @return {*}
*/
getCheckSenderAddress(bool?) {
if(bool){
this.isSpinning = true;
this.loadingTips = 'Checking Sender Address';
}
return new Promise<boolean>((resolve, reject) => {
this.subscriptions.push(this.checkSenderAddress$.subscribe((checkSenderAddress:boolean) => {
setTimeout(()=>{
this.isSpinning = false;
resolve(checkSenderAddress);
}, bool? 500 : 0)
},reject));
});
}
getCheckShipToAddress(bool?) {
if(bool){
this.isSpinning = true;
this.loadingTips = 'Checking Receiver Address';
}
return new Promise<boolean>((resolve, reject) => {
this.subscriptions.push(this.checkShipToAddress$.subscribe((checkShipToAddress:boolean) => {
setTimeout(()=>{
this.isSpinning = false;
resolve(checkShipToAddress);
}, bool? 600 : 0)
},reject));
});
}
getCheckPackageValidation(bool?) {
if(bool){
this.isSpinning = true;
this.loadingTips = 'Checking Package Info';
}
return new Promise<boolean>((resolve, reject) => {
this.subscriptions.push(this.checkPackageValidation$.subscribe((checkPackageValidation:boolean) => {
setTimeout(()=>{
this.isSpinning = false;
resolve(checkPackageValidation);
}, bool? 700 : 0)
},reject));
});
}