I'm listening to an event from a 3th party control, pre moving from one stage to another (process flow). Within that method you are able to block the progress, preventing the user to move to the next stage. However, if I subscribe to this event with an async method, that blocking method does not have any effect (which is logical)
Unfortunately I need to call an api (fetching data) that only support async calls. This is to check if the user is able to progress or not. So I need to be able to either let the main execution of my method 'pauze' during the async method call or able to call it in a sync way.
I tried with a boolean that is set to false in the .then condition of the promise like this :
let runningAsync = true
AsyncMethod.then(function() {runningAsync = false})
while (runningAsync)
{
}
This does stop my execution on my sync method BUT within my AsyncMethod I have the call to that async API. And for some reason it just hangs on that call as if it's unable to complete (probably due to the while loop somewhere).
Been breaking my head on this but can't find a proper solution for this issue. Any suggestion would be much appreciated ...
Regards, Sven