diff --git a/app/components/FilesEditor/index.tsx b/app/components/FilesEditor/index.tsx index 2f557cf..5cdcfd9 100644 --- a/app/components/FilesEditor/index.tsx +++ b/app/components/FilesEditor/index.tsx @@ -47,7 +47,7 @@ const initialRenamePopupState: RenamePopupState = { const Index = () => { const [apiKey, setApiKey] = useState( - "ptlc_N77A2hEczFmSwGXm4cEXh4Gw3ZP0Ygr5NaBkGlE7pjU" + `${process.env.NEXT_PUBLIC_API_KEY}` ); const [fileList, setFileList] = useState([]); const [contextMenu, setContextMenu] = useState( @@ -112,15 +112,14 @@ const Index = () => { ); useEffect(() => { - const setupApplication = async () => { + const setupApplication = () => { if (!apiKey || !serverId) return; // Upewniamy się, że mamy apiKey i serverId if (!ptero) { - console.log("tworze instancje ptero"); - const pteroInstance = await new Pterodactyl(serverId, apiKey); + const pteroInstance = new Pterodactyl(serverId, apiKey); setPtero(pteroInstance); pteroInstance.helpers.setWorkingDirectory(pathParam); - await fetchFiles(pteroInstance); // Wywołanie fetchFiles raz po ustawieniu instancji + fetchFiles(pteroInstance); // Wywołanie fetchFiles raz po ustawieniu instancji } };