generated from nhcarrigan/template
fix: remove frontend calls to deleted log_discord_rpc command
Removes all frontend invocations of the log_discord_rpc command that was
deleted in the Discord RPC refactor (edd8fa5). The frontend was still
calling this command during Discord RPC initialization, causing errors
that prevented the close confirmation modal event listener from being
registered.
The root cause:
1. initializeDiscordRpc() called invoke("log_discord_rpc")
2. Command doesn't exist anymore, promise rejects
3. await stops execution before close event listener setup
4. Close modal never works
Replaced all log_discord_rpc calls with console.log since the backend
already uses the tracing framework for Discord RPC logging.
Fixes: Close confirmation modal not appearing after Discord RPC refactor
This commit is contained in:
+1
-14
@@ -448,10 +448,6 @@ export async function initializeDiscordRpc() {
|
||||
const startedAtUnixSeconds = Math.floor(startedAt.getTime() / 1000);
|
||||
const model = config.model || "claude";
|
||||
|
||||
await invoke("log_discord_rpc", {
|
||||
message: `[FRONTEND] Attempting to initialize Discord RPC: session='Idle', model='${model}', timestamp=${startedAtUnixSeconds}`,
|
||||
});
|
||||
|
||||
console.log("Initializing Discord RPC with initial activity:", {
|
||||
session_name: "Idle",
|
||||
model,
|
||||
@@ -464,23 +460,14 @@ export async function initializeDiscordRpc() {
|
||||
startedAt: startedAtUnixSeconds,
|
||||
});
|
||||
|
||||
await invoke("log_discord_rpc", {
|
||||
message: "[FRONTEND] Discord RPC initialized successfully!",
|
||||
});
|
||||
|
||||
console.log("Discord RPC initialized successfully with initial presence");
|
||||
} catch (error) {
|
||||
const errorMessage = error instanceof Error ? error.message : String(error);
|
||||
await invoke("log_discord_rpc", {
|
||||
message: `[FRONTEND] ERROR: Failed to initialize Discord RPC: ${errorMessage}`,
|
||||
});
|
||||
console.error("Failed to initialize Discord RPC:", error);
|
||||
console.warn("Discord RPC will be unavailable. Make sure Discord is running.");
|
||||
}
|
||||
} else {
|
||||
await invoke("log_discord_rpc", {
|
||||
message: "[FRONTEND] Discord RPC is disabled in config, skipping initialization",
|
||||
});
|
||||
console.log("Discord RPC is disabled in config, skipping initialization");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user