Skip to content

Commit d2955b9

Browse files
committed
Only request servers as an admin if actually an admin; closes pterodactyl#3242
1 parent db64f54 commit d2955b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

resources/scripts/components/dashboard/DashboardContainer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ export default () => {
2525
const [ showOnlyAdmin, setShowOnlyAdmin ] = usePersistedState(`${uuid}:show_all_servers`, false);
2626

2727
const { data: servers, error } = useSWR<PaginatedResult<Server>>(
28-
[ '/api/client/servers', showOnlyAdmin, page ],
29-
() => getServers({ page, type: showOnlyAdmin ? 'admin' : undefined }),
28+
[ '/api/client/servers', (showOnlyAdmin && rootAdmin), page ],
29+
() => getServers({ page, type: (showOnlyAdmin && rootAdmin) ? 'admin' : undefined }),
3030
);
3131

3232
useEffect(() => {

0 commit comments

Comments
 (0)