mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-10 01:03:36 -05:00
Filter mutual servers properly
This commit is contained in:
parent
3d707a64da
commit
ac04bd2b44
1 changed files with 3 additions and 4 deletions
|
@ -74,9 +74,8 @@ export const UserProfile = observer(
|
|||
channel.recipient_ids!.includes(user_id),
|
||||
);
|
||||
|
||||
// Fix this once an API route for fetching mutual servers exists
|
||||
const mutualServers = [...client.servers.values()].filter(
|
||||
(server) => true,
|
||||
const mutualServers = mutual?.servers.map((id) =>
|
||||
client.servers.get(id),
|
||||
);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
|
@ -428,7 +427,7 @@ export const UserProfile = observer(
|
|||
)}
|
||||
{tab === "servers" && (
|
||||
<div className={styles.entries}>
|
||||
{mutualServers.length === 0 ? (
|
||||
{!mutualServers || mutualServers.length === 0 ? (
|
||||
<div className={styles.empty}>
|
||||
<Text id="app.special.popovers.user_profile.no_servers" />
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue