I would like to make it possible for users to select whether they are listed in the directory. Unfortunately, the “Hide my public profile and presence features” setting only hides info such as the bio, not the full entry for the user.
I’ve been banging my head against this for a while and so far I have come up with this diff:
This gets me really close! `user_fields[“3”] is a checkbox that users can select to opt-in to being included in the directory.
The only problem is the lazy loading on the directory page. It loads 50 users and I filter out any that don’t have the box selected. But it won’t load any more until I start scrolling, even if there is only 1 users in the first 50 that have opted-in.
Is there a way to make this page load more than 50 users? Or perhaps to load more users right away instead of waiting for a scroll event?
Edit: This is quite a hack, but I have added a window.scrollBy(0, 5);
in that function before returning userCardInfos
. I don’t love it, but it does cause the page to load more users.