MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / clearChatHistory

Function clearChatHistory

deployments/desktop/static/desktop.js:4442–4461  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4440 }
4441
4442 async function clearChatHistory() {
4443 const count = state.chatHistory.length;
4444 if (!count) {
4445 showFeedbackToast("warning", ui().chat.noHistoryTitle, ui().chat.noHistoryDetail);
4446 return;
4447 }
4448 const confirmed = window.confirm(ui().chat.clearConfirm(count));
4449 if (!confirmed) return;
4450 const data = await api("/api/chat/sessions/clear", {
4451 method: "POST",
4452 body: JSON.stringify({ user_id: currentUser() })
4453 });
4454 state.chatSessionId = "";
4455 state.chatHistory = [];
4456 state.chatHistoryGroups = [];
4457 resetChatThread();
4458 renderChatSources([]);
4459 renderChatHistory({ sessions: [], groups: [] });
4460 showFeedbackToast("success", ui().chat.clearedTitle, ui().chat.clearedDetail(data.deleted || count));
4461 }
4462
4463 function startNewChat(options = {}) {
4464 state.chatSessionId = "";

Callers

nothing calls this directly

Calls 7

showFeedbackToastFunction · 0.85
uiFunction · 0.85
currentUserFunction · 0.85
resetChatThreadFunction · 0.85
renderChatSourcesFunction · 0.85
renderChatHistoryFunction · 0.85
apiFunction · 0.70

Tested by

no test coverage detected