From f2716d5e94a0e7ec8ff8eb321623c2b458827a8a Mon Sep 17 00:00:00 2001 From: "italiano@oplabs.co" Date: Tue, 17 Dec 2024 12:14:27 -0500 Subject: [PATCH] removes server --- packages/cli/src/commands/_app.tsx | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/packages/cli/src/commands/_app.tsx b/packages/cli/src/commands/_app.tsx index 52fe7fa..197548f 100644 --- a/packages/cli/src/commands/_app.tsx +++ b/packages/cli/src/commands/_app.tsx @@ -2,8 +2,7 @@ import type {AppProps} from 'pastel'; import {QueryClient, QueryClientProvider} from '@tanstack/react-query'; import {useInput} from 'ink'; import {DbProvider} from '@/db/dbContext'; -import {useEffect, useState} from 'react'; -import {startServer} from '@/server/startServer'; +import {useState} from 'react'; import {Spinner} from '@inkjs/ui'; export const queryClient = new QueryClient(); @@ -11,32 +10,6 @@ export const queryClient = new QueryClient(); export default function App({Component, commandProps}: AppProps) { const [isExiting, setIsExiting] = useState(false); - useEffect(() => { - let server: Awaited> | undefined; - - // Start the server and store the reference - startServer() - .then(s => { - server = s; - }) - .catch(err => { - console.error('Failed to start server:', err); - }); - - // Cleanup function - return () => { - if (server) { - setIsExiting(true); - // Use the callback to ensure the server is fully closed - server.close(err => { - if (err) { - console.error('Error while closing server:', err); - } - process.exit(); - }); - } - }; - }, []); useInput((input, key) => { if (input === 'c' && key.ctrl) {