1
1
mirror of https://github.com/pterodactyl/panel.git synced 2024-11-22 09:02:28 +01:00

Only request servers as an admin if actually an admin; closes #3242

This commit is contained in:
Dane Everitt 2021-04-20 20:41:08 -07:00
parent db64f54010
commit d2955b9361
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53

View File

@ -25,8 +25,8 @@ export default () => {
const [ showOnlyAdmin, setShowOnlyAdmin ] = usePersistedState(`${uuid}:show_all_servers`, false);
const { data: servers, error } = useSWR<PaginatedResult<Server>>(
[ '/api/client/servers', showOnlyAdmin, page ],
() => getServers({ page, type: showOnlyAdmin ? 'admin' : undefined }),
[ '/api/client/servers', (showOnlyAdmin && rootAdmin), page ],
() => getServers({ page, type: (showOnlyAdmin && rootAdmin) ? 'admin' : undefined }),
);
useEffect(() => {