The store was emitting QUEUE_LOADING/false events before the
task queue was actually updated. Consumers of the loading
event were getting an outdated task count.
In I75dcffaa35138165be22658f1844d98ea9af6384 we introduced
the same approach but it caused issues in the post edit dialog,
see T360469. The issues were caused by the store methods
hasPreviousTask and hasNextTask returning false while the
loading property has not yet been updated after fetching
tasks.
Emit the queue loading event after the queue
is updated and make store getters return the prev/next
computed value independently from the task queue loading
or not.
Note: the source problem remains in FiltersDialog.updateLoadingState
being only subscribed to TASK_QUEUE_LOADING and not task queue
changes. Consider refactoring it in follow-up in two different
handlers, one for loading state and another for new task counts.
Also consider using a state management solution eg Pinia.
Bug: T359992
Change-Id: Ib545b9f24ea6b84504a8ba4d2c4561737be9be0b