Skip to content

Commit 49d2a42

Browse files
committed
reset api key
1 parent 943d8d5 commit 49d2a42

2 files changed

Lines changed: 32 additions & 5 deletions

File tree

src/views/TopicHistogram.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,7 @@ const TopicHistogram: FC = () => {
196196
const [isLoadingExplanation, setIsLoadingExplanation] = useState(false);
197197

198198
// State for API key
199-
const [apiKey, setApiKey] = useState<string>(() => {
200-
// Try to get from localStorage first
201-
return localStorage.getItem('GOOGLE_API_KEY') || '';
202-
});
199+
const [apiKey, setApiKey] = useState<string>('');
203200

204201
// Add API key input modal - initialize to false instead of !apiKey
205202
const [showApiKeyModal, setShowApiKeyModal] = useState(false);
@@ -232,7 +229,6 @@ const TopicHistogram: FC = () => {
232229
// Function to save API key and fetch explanation if a topic was clicked
233230
const saveApiKey = (key: string) => {
234231
setApiKey(key);
235-
localStorage.setItem('GOOGLE_API_KEY', key);
236232
setShowApiKeyModal(false);
237233

238234
// If there was a topic waiting for explanation, fetch it now

start.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
#!/bin/bash
22

3+
# Function to check if a port is in use
4+
check_port() {
5+
lsof -i :$1 >/dev/null 2>&1
6+
return $?
7+
}
8+
9+
# Function to kill process using a port
10+
kill_port() {
11+
local port=$1
12+
if check_port $port; then
13+
echo "Port $port is in use. Attempting to kill the process..."
14+
lsof -ti :$port | xargs kill -9 2>/dev/null
15+
sleep 1
16+
if check_port $port; then
17+
echo "Failed to kill process on port $port. Please check manually."
18+
exit 1
19+
else
20+
echo "Successfully killed process on port $port"
21+
fi
22+
fi
23+
}
24+
25+
# Kill any existing process on port 5002
26+
kill_port 5002
27+
328
# Start the Gunicorn backend server in the background
429
echo "Starting backend server..."
530
cd backend/app
@@ -8,6 +33,12 @@ gunicorn -b 127.0.0.1:5002 main:app &
833
# Wait a moment for the backend to start
934
sleep 2
1035

36+
# Verify backend is running
37+
if ! check_port 5002; then
38+
echo "Failed to start backend server. Please check the logs."
39+
exit 1
40+
fi
41+
1142
# Start the frontend development server
1243
echo "Starting frontend server..."
1344
cd ../..

0 commit comments

Comments
 (0)