I came up with a small idea actually. If for a few users (like 5 -8) it is not affecting performance, maybe just add map for logged users (and eventually add some limit for the map)? Big communities won't benefit from it, but it is simplest solution that can help (I have no idea what I am writing about.)
I also don't understand why you are using '==' instead of '===' so I won't get a girlfriend any soon 😅