Page MenuHomePhabricator

[lib] introduce loading logic to useRelationshipPrompt
Needs ReviewPublic

Authored by ginsu on Thu, Jun 27, 12:18 PM.
Tags
None
Referenced Files
F2152748: D12593.diff
Sun, Jun 30, 3:47 PM
Unknown Object (File)
Sat, Jun 29, 2:34 AM
Unknown Object (File)
Sat, Jun 29, 2:34 AM
Unknown Object (File)
Sat, Jun 29, 2:34 AM
Subscribers

Details

Reviewers
inka
Summary

This diff introduces the loading logic needed for the relationship prompts on both web and native. Initially, I thought about using createLoadingStatusSelector to implement the loading logic; however, the issue with this was that we sometimes show two relationship buttons and using a single createLoadingStatusSelector would cause both button to show loading spinners at the same time even though one button was pressed, which I felt was a bit strange. So I introduced 4 separate loading states (one for each action) and returned those values in this hook to be consumed on both web + native

Test Plan

At the end of the stack confirmed that the relationship prompt buttons were being disabled + showing some sort of visual indication to the user that the action is loading

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage