I know that very similar questions have been asked, but I can't find one that fits my issue exactly- feel free to point me that way if there is one.
sendSteamAuthTicket: () => {
return new Promise((resolve, reject) => {
greenworks.getAuthSessionTicket(function(ticket) {
console.log('Successfully retrieved Steam API User Auth Ticket.')
console.log(ticket.ticket.toString('hex'))
resolve(ticket.ticket.toString('hex'))
}, function(e) { throw e })
})
}
Basically, this returns an endlessly pending Promise, leading me to believe I can't resolve a Promise from within a nested callback like this. Unfortunately, I can't send the data via an additional function because electron won't let you interface with the browser that way.
Is it possible to do what I'm trying to do here? e.g. more or less obtain a delayed Promise value within this single function?