This PR solves the bug due to which "M" and "A" indicators were not displayed in comment headers in post detail screen.
Unfortunately, this was not a simple bug (and the "A" indicator had to be implemented from scratch), but as soon as I started looking into it I opened a Pandora's box because:
admin determination was unreliable (and possibly not working at all on recent Lemmy instances, due to an API change)
mod determination was not working in post detail, which was the cause of the original bug
downvote enabled and community creation enabled determination was repeated multiple times, could lead to unnecessary API calls making it possibly fragile and certainly inefficient.
This PR puts a remedy to all that, centralizing all checks in a single component (LemmyValueCache) and querying it, plus determining correctly whether a user is an admin or a mod.
This PR solves the bug due to which "M" and "A" indicators were not displayed in comment headers in post detail screen.
Unfortunately, this was not a simple bug (and the "A" indicator had to be implemented from scratch), but as soon as I started looking into it I opened a Pandora's box because:
This PR puts a remedy to all that, centralizing all checks in a single component (
LemmyValueCache
) and querying it, plus determining correctly whether a user is an admin or a mod.