From b4ec2a26b60b88cdf9d8d1618f3a629091960d73 Mon Sep 17 00:00:00 2001 From: Moepchi Date: Thu, 6 Aug 2026 01:50:53 +0200 Subject: [PATCH] Fix blank Server/Channel Gruppen tabs when the group list can't load MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit servergrouplist/channelgrouplist decline silently on the server when the account lacks permission to see them (no reply at all - same behavior as banlist/complainlist elsewhere in this app). The permissions editor's group list only rendered when it had data, so a permission-limited account just saw a permanently blank left panel with no explanation (reported by a screenshot from the real server). Added the same loading/6s-timeout/"nicht verfügbar" fallback every other list dialog in this app already uses (GroupAssignDialog, banlist, etc.) - now shows a loading indicator, then a clear "unavailable" message instead of nothing. Verified in demo mode: both Server Gruppen and Channel Gruppen tabs still list their (demo) groups correctly - no regression from the loading-state change. --- web/src/App.tsx | 55 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 18 deletions(-) diff --git a/web/src/App.tsx b/web/src/App.tsx index 9574a05..8a9a2aa 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -2072,7 +2072,19 @@ function PermissionsEditorDialog({ const [addNegated, setAddNegated] = useState(false); const [addSkip, setAddSkip] = useState(false); + const isGroupScope = scope === "server" || scope === "channelgroup"; const groupList = scope === "server" ? serverGroups : scope === "channelgroup" ? channelGroups : null; + // The channelgrouplist/servergrouplist requests decline silently when the + // account lacks the permission to see them (no reply at all, same as + // banlist/complainlist elsewhere) - without this, a permission-limited + // account just sees a permanently blank panel with no explanation. + const [groupsTimedOut, setGroupsTimedOut] = useState(false); + useEffect(() => { + setGroupsTimedOut(false); + if (groupList) return; + const id = window.setTimeout(() => setGroupsTimedOut(true), 6000); + return () => window.clearTimeout(id); + }, [groupList]); // (ids, ready) for the currently selected target under the active tab - // ready is false while a required piece (channel/client) hasn't been picked yet. @@ -2146,24 +2158,31 @@ function PermissionsEditorDialog({
- {groupList && ( -
    - {groupList.length === 0 &&
  • {t("groupAssign.empty")}
  • } - {groupList.map((g) => ( -
  • - -
  • - ))} -
- )} + {isGroupScope && + (groupList ? ( +
    + {groupList.length === 0 && ( +
  • {t("groupAssign.empty")}
  • + )} + {groupList.map((g) => ( +
  • + +
  • + ))} +
+ ) : ( +
+ {groupsTimedOut ? t("connectionInfo.unavailable") : t("connectionInfo.loading")} +
+ ))} {(scope === "channel" || scope === "channelclient") && (
    {channels.map((c) => (