mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-08 01:45:28 +00:00
Fix member list for sidebar + the feature where only users with viewchannel perms are displayed within the member sidebar
This commit is contained in:
@@ -4,7 +4,7 @@ import { observer } from "mobx-react-lite";
|
|||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
import { Channel, Server, User, API } from "revolt.js";
|
import { Channel, Server, User, API } from "revolt.js";
|
||||||
|
|
||||||
import { useEffect, useLayoutEffect, useState } from "preact/hooks";
|
import { useEffect, useState } from "preact/hooks";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
useSession,
|
useSession,
|
||||||
@@ -90,7 +90,10 @@ function useEntries(
|
|||||||
const sort = member?.nickname ?? u.username;
|
const sort = member?.nickname ?? u.username;
|
||||||
const entry = [u, sort] as [User, string];
|
const entry = [u, sort] as [User, string];
|
||||||
|
|
||||||
if (member?.hasPermission(channel, "ViewChannel")) {
|
if (
|
||||||
|
member?.hasPermission(channel, "ViewChannel") ||
|
||||||
|
channel.recipient_ids?.includes(u._id)
|
||||||
|
) {
|
||||||
if (!u.online || u.status?.presence === "Invisible") {
|
if (!u.online || u.status?.presence === "Invisible") {
|
||||||
categories.offline.push(entry);
|
categories.offline.push(entry);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user