I am using a printing tool in which i try to find the printers as follows
this.Printers = qz.websocket.connect().then(() => {
return qzTray.printers.find("found a printer");
}).then((found) => {
this.Printers = found;
return this.Printers;
}).catch((e) => {
console.log('failed printing');
this.Printers=null;
return this.printers
}
so when the above runs and it finds a printer this.Printers has a value as. which is correct
this.Printers = "Found a printer"
But when i cant find a printer this.Printers looks like
Promise {<pending>}__proto__: Promise[[PromiseState]]: "pending"[[PromiseResult]]: undefined
so in my catch i tried
to assign this.Printers=null
as a test to see if it returns that out but it doesnt i still get
Promise {<pending>}__proto__: Promise[[PromiseState]]: "pending"[[PromiseResult]]: undefined
how can i assign this.Printers when it fails to use [[PromiseResult]]: undefined or null?