HomePhabricator

Fix check for in-flight API requests

Authored by matthiasmullie.

Description

Fix check for in-flight API requests

This was originally no problem since the inprogress class was
removed right after the API call, instead of (now) after running
all apiHandlers.

We really only want the class to be removed after processing all
apiHandlers (which, in turn could take some time because they may
need to fetch other data from APIs...)

Changing topics sort order, for example, adds this class to a
container div encompassing all topics. One of those apiHandlers
triggers the TOC to update as well (to reflect the new topic order),
which would find that there is a .closest( '.flow-api-inprogress' )

This check can be limited to API calls of the same type on the
same target.

Bug: T97820
Change-Id: Iefc020e448fcf896b4bab44771dd65b137e53cae

Details