Here is my javascript code sample. I want the steps to be executed in the same order. I found out that "Activity Id" has stale value in the localStorage. What's the trick to making sure that all these steps execute in the exact same order and each one waits for the last to line to complete. Appreciate.
await quickActivityCreateDB.trigger();
var activityId = quickActivityCreateDB.data['Activity Id'];
localStorage.setValue("activityId", activityId);
await findActivityDetailDB.trigger();
quickActivityPopupBtn.close();