Skip to content

Commit 726ffdb

Browse files
eisbawclaude
authored andcommitted
fix: resolve TypeScript compilation errors after rebase
- Remove unused tauriOpen import in ClaudeCodeSession - Replace invoke() with apiCall() in api.ts for web compatibility - Fix unused variable warnings These changes ensure the frontend builds correctly with the new web server mode while maintaining compatibility with Tauri desktop mode. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 1b08ced commit 726ffdb

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

src/components/ClaudeCodeSession.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ import { api, type Session } from "@/lib/api";
1717
import { cn } from "@/lib/utils";
1818

1919
// Conditional imports for Tauri APIs
20-
let tauriOpen: any;
2120
let tauriListen: any;
2221
type UnlistenFn = () => void;
2322

2423
try {
2524
if (typeof window !== 'undefined' && window.__TAURI__) {
26-
tauriOpen = require("@tauri-apps/plugin-dialog").open;
2725
tauriListen = require("@tauri-apps/api/event").listen;
2826
}
2927
} catch (e) {
@@ -49,7 +47,6 @@ const listen = tauriListen || ((eventName: string, callback: (event: any) => voi
4947
window.removeEventListener(eventName, domEventHandler);
5048
});
5149
});
52-
const open = tauriOpen || (() => Promise.resolve([]));
5350
import { StreamMessage } from "./StreamMessage";
5451
import { FloatingPromptInput, type FloatingPromptInputRef } from "./FloatingPromptInput";
5552
import { ErrorBoundary } from "./ErrorBoundary";

src/lib/api.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ export const api = {
454454
*/
455455
async getHomeDirectory(): Promise<string> {
456456
try {
457-
return await invoke<string>("get_home_directory");
457+
return await apiCall<string>("get_home_directory");
458458
} catch (error) {
459459
console.error("Failed to get home directory:", error);
460460
return "/";
@@ -481,7 +481,7 @@ export const api = {
481481
*/
482482
async createProject(path: string): Promise<Project> {
483483
try {
484-
return await invoke<Project>('create_project', { path });
484+
return await apiCall<Project>('create_project', { path });
485485
} catch (error) {
486486
console.error("Failed to create project:", error);
487487
throw error;
@@ -871,7 +871,7 @@ export const api = {
871871
*/
872872
async listAgentRunsWithMetrics(agentId?: number): Promise<AgentRunWithMetrics[]> {
873873
try {
874-
return await invoke<AgentRunWithMetrics[]>('list_agent_runs_with_metrics', { agentId });
874+
return await apiCall<AgentRunWithMetrics[]>('list_agent_runs_with_metrics', { agentId });
875875
} catch (error) {
876876
console.error("Failed to list agent runs with metrics:", error);
877877
// Return empty array instead of throwing to prevent UI crashes

0 commit comments

Comments
 (0)