# Is there a global boolean "is uploading" somewhere?

**URL:** <https://community.transloadit.com/t/is-there-a-global-boolean-is-uploading-somewhere/16475>\
**Category:** Uppy\
**Created:** [February 15, 2023, 5:31pm UTC](https://community.transloadit.com/t/is-there-a-global-boolean-is-uploading-somewhere/16475 "2023-02-15T17:31:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sneko](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/sneko/32/786_2.png) [@sneko](https://community.transloadit.com/u/sneko)\
**Post date:** [February 15, 2023, 5:31pm UTC](https://community.transloadit.com/t/is-there-a-global-boolean-is-uploading-somewhere/16475/1 "2023-02-15T17:31:59Z")

</div>

Hi,

I looked at the documentation and typings in the code on my Uppy instance but I’m unable to find something telling me “an upload is ongoing”.

My use case is I want to prevent submitting a form (or leaving the page) while some uploads are still ongoing.

A workaround would be to list all files and try to see for each:

- `isPaused` is true OR if `progress.percentage === 100`

But it seems a bit hacky, no?

Thank you,

---

<div class="post-metadata">

**Author:** ![mifi](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/mifi/32/603_2.png) [@mifi](https://community.transloadit.com/u/mifi)\
**Post date:** [February 16, 2023, 5:38am UTC](https://community.transloadit.com/t/is-there-a-global-boolean-is-uploading-somewhere/16475/2 "2023-02-16T05:38:50Z")

</div>

Hi. I think you can use the `upload` event [Uppy — Uppy](https://uppy.io/docs/uppy/#upload) to set your bool to true

then `complete` [Uppy — Uppy](https://uppy.io/docs/uppy/#complete) to set the bool to false again

---

<div class="post-metadata">

**Author:** ![sneko](https://yyz2.discourse-cdn.com/flex032/user_avatar/community.transloadit.com/sneko/32/786_2.png) [@sneko](https://community.transloadit.com/u/sneko)\
**Post date:** [February 20, 2023, 3:33pm UTC](https://community.transloadit.com/t/is-there-a-global-boolean-is-uploading-somewhere/16475/3 "2023-02-20T15:33:17Z")

</div>

Sounds like a good idea @mifi , a bit surprized there is no simple boolean for this but I’m fine with your solution 🙂

I tried to implement it but it seems I have a weird behavior for events with React: [Uppy + Transloadit immediately triggers "complete" event but no upload · Issue #4130 · transloadit/uppy · GitHub](https://github.com/transloadit/uppy/issues/4130#issuecomment-1437198535)
