Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 0 additions & 93 deletions vite-app/dist/assets/index-CmEkuH8E.js

This file was deleted.

1 change: 0 additions & 1 deletion vite-app/dist/assets/index-CmEkuH8E.js.map

This file was deleted.

1 change: 1 addition & 0 deletions vite-app/dist/assets/index-CpScNe1P.css

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion vite-app/dist/assets/index-DZwKPeo5.css

This file was deleted.

93 changes: 93 additions & 0 deletions vite-app/dist/assets/index-dHlKwEPE.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions vite-app/dist/assets/index-dHlKwEPE.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions vite-app/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>EP | Log Viewer</title>
<link rel="icon" href="/assets/favicon-BkAAWQga.png" />
<script type="module" crossorigin src="/assets/index-CmEkuH8E.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-DZwKPeo5.css">
<script type="module" crossorigin src="/assets/index-dHlKwEPE.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-CpScNe1P.css">
</head>
<body>
<div id="root"></div>
Expand Down
12 changes: 9 additions & 3 deletions vite-app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ const App = observer(() => {

ws.onopen = () => {
console.log("Connected to file watcher");
state.isConnected = true;
state.setConnected(true);
state.setLoading(true); // Set loading when connection opens
reconnectAttemptsRef.current = 0; // Reset reconnect attempts on successful connection
};

Expand All @@ -48,18 +49,21 @@ const App = observer(() => {
console.log("initialize_logs", rows);
state.upsertRows(rows);
} else if (update.type === "log") {
state.setLoading(true); // Set loading for individual log updates
const row: EvaluationRow = EvaluationRowSchema.parse(update.row);
console.log("log", row);
state.upsertRows([row]);
}
} catch (error) {
console.error("Failed to parse WebSocket message:", error);
state.setLoading(false); // Clear loading state on error
}
};

ws.onclose = (event) => {
console.log("Disconnected from file watcher", event.code, event.reason);
state.isConnected = false;
state.setConnected(false);
state.setLoading(false); // Clear loading state on disconnect

// Attempt to reconnect if not a normal closure
if (
Expand All @@ -72,7 +76,8 @@ const App = observer(() => {

ws.onerror = (error) => {
console.error("WebSocket error:", error);
state.isConnected = false;
state.setConnected(false);
state.setLoading(false); // Clear loading state on error
};
};

Expand All @@ -99,6 +104,7 @@ const App = observer(() => {

// Manual refresh handler
const handleManualRefresh = () => {
state.setLoading(true); // Set loading when manually refreshing
if (wsRef.current) {
try {
wsRef.current.onclose = null; // Prevent triggering reconnect logic
Expand Down
Loading
Loading