mirror of
https://github.com/revoltchat/revite.git
synced 2024-12-26 23:42:11 -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),
|
channel.recipient_ids!.includes(user_id),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Fix this once an API route for fetching mutual servers exists
|
const mutualServers = mutual?.servers.map((id) =>
|
||||||
const mutualServers = [...client.servers.values()].filter(
|
client.servers.get(id),
|
||||||
(server) => true,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
useLayoutEffect(() => {
|
||||||
|
@ -428,7 +427,7 @@ export const UserProfile = observer(
|
||||||
)}
|
)}
|
||||||
{tab === "servers" && (
|
{tab === "servers" && (
|
||||||
<div className={styles.entries}>
|
<div className={styles.entries}>
|
||||||
{mutualServers.length === 0 ? (
|
{!mutualServers || mutualServers.length === 0 ? (
|
||||||
<div className={styles.empty}>
|
<div className={styles.empty}>
|
||||||
<Text id="app.special.popovers.user_profile.no_servers" />
|
<Text id="app.special.popovers.user_profile.no_servers" />
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue