HomePhabricator
Diffusion Comm c29df39551af

[native] have upload thread avatar processing/uploading loader only appear for…

Description

[native] have upload thread avatar processing/uploading loader only appear for thread being updated

Summary:
In selectFromGalleryAndUpdateThreadAvatar we had a piece of state called processingOrUploadInProgress that would keep track of when we were uploading or processing the image the user selected in the setting image avatar process. We previously kept track of this state using a boolean; however, with this state now being used in this provider we need a more robust way to keep track of this state for a thread, and make sure this state is not shared across different threads.

To fix this, I changed the type of this state to be a Set<string> from boolean. This set will keep track of all the thread ids that are actively uploading or processing an image for a new thread avatar. We then have threadAvatarSaveInProgress check if this set has the active threadID currently in this set will update the loader accordingly

Depends on D7684

Test Plan:
I tested setting an image thread avatar with a delayed upload/processing and the image thread avatar loaders are only shown in the correct thread

Reviewers: ashoat, atul

Reviewed By: ashoat

Subscribers: ashoat, tomek, atul

Differential Revision: https://phab.comm.dev/D7643