[lib] Prevent the influx of SEARCH_USERS_[STARTED/SUCCESS] actions
Summary:
In useSearchUsers we call the searchUsers endpoint every time the hook is called. We don't have a need for dispatching the SEARCH_USERS action when the provided search text is empty, because we don't even call the endpoint in that case. In that case, we just set the server search results to an empty array.
Addresses [[ https://linear.app/comm/issue/ENG-6046/saw-lots-of-search-users-[startedsuccess]-in-redux-devtools#comment-5209e0bd | ENG-6046 ]]
Test Plan:
I repro'd in the same way @atul did in the original Linear task - by having keyserver restart due to code changes (in this case, just by adding a console.log() in keyserver.js and watching the dev tools)
Before:
After:
Reviewers: atul, michal, ashoat
Reviewed By: ashoat
Subscribers: ashoat, tomek, atul
Differential Revision: https://phab.comm.dev/D10312