mirror of
https://github.com/pterodactyl/panel.git
synced 2026-12-01 11:55:51 -05:00
14 lines
404 B
TypeScript
14 lines
404 B
TypeScript
import { useCurrentServer } from '@/api/server/queries';
|
|
import type { Server } from '@/api/server/types';
|
|
|
|
/** The current server, which the server area loads before any of its views render. */
|
|
export function useLoadedServer(): Server {
|
|
const server = useCurrentServer();
|
|
|
|
if (!server) {
|
|
throw new Error('Server views render once their server has loaded.');
|
|
}
|
|
|
|
return server;
|
|
}
|