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