generated from nhcarrigan/template
fix: ensure permission/stats persist until explicit disconnect #110
@@ -4,7 +4,7 @@
|
||||
import { claudeStore } from "$lib/stores/claude";
|
||||
import { characterState } from "$lib/stores/character";
|
||||
import type { PermissionRequest } from "$lib/types/messages";
|
||||
import { updateDiscordRpc } from "$lib/tauri";
|
||||
import { updateDiscordRpc, setSkipNextGreeting } from "$lib/tauri";
|
||||
import { conversationsStore } from "$lib/stores/conversations";
|
||||
import { configStore } from "$lib/stores/config";
|
||||
|
||||
@@ -49,6 +49,9 @@
|
||||
throw new Error("No active conversation");
|
||||
}
|
||||
|
||||
// Prevent stats reset on reconnection
|
||||
setSkipNextGreeting(true);
|
||||
|
||||
await invoke("stop_claude", { conversationId });
|
||||
|
||||
// Small delay to ensure clean shutdown
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
createSummary,
|
||||
sanitizeForJson,
|
||||
} from "$lib/utils/conversationUtils";
|
||||
import { updateDiscordRpc } from "$lib/tauri";
|
||||
import { updateDiscordRpc, setSkipNextGreeting } from "$lib/tauri";
|
||||
|
||||
const DISCORD_URL = "https://chat.nhcarrigan.com";
|
||||
const DONATE_URL = "https://donate.nhcarrigan.com";
|
||||
@@ -251,6 +251,9 @@
|
||||
: sanitizedContent;
|
||||
|
||||
// Step 1: Disconnect from Claude to reset context
|
||||
// Prevent stats reset on reconnection
|
||||
setSkipNextGreeting(true);
|
||||
|
||||
if (connectionStatus === "connected") {
|
||||
await invoke("stop_claude", { conversationId: activeId });
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import { claudeStore, hasQuestionPending } from "$lib/stores/claude";
|
||||
import { characterState } from "$lib/stores/character";
|
||||
import type { UserQuestionEvent } from "$lib/types/messages";
|
||||
import { updateDiscordRpc } from "$lib/tauri";
|
||||
import { updateDiscordRpc, setSkipNextGreeting } from "$lib/tauri";
|
||||
import { conversationsStore } from "$lib/stores/conversations";
|
||||
import { configStore } from "$lib/stores/config";
|
||||
|
||||
@@ -89,6 +89,9 @@
|
||||
claudeStore.clearQuestion();
|
||||
|
||||
try {
|
||||
// Prevent stats reset on reconnection
|
||||
setSkipNextGreeting(true);
|
||||
|
||||
await invoke("stop_claude", { conversationId });
|
||||
|
||||
await new Promise((resolve) => setTimeout(resolve, 500));
|
||||
|
||||
Reference in New Issue
Block a user