MCPcopy Create free account
hub / github.com/CreminiAI/skillpack / loadConversationHistory

Function loadConversationHistory

web/js/chat.js:337–357  ·  view source on GitHub ↗
(channelId)

Source from the content-addressed store, hash-verified

335}
336
337async function loadConversationHistory(channelId) {
338 const messages = await getConversationMessages(channelId, 200);
339 const messagesEl = document.getElementById("messages");
340 const chatArea = document.getElementById("chat-area");
341
342 messagesEl.innerHTML = "";
343 chatHistory.length = 0;
344
345 for (const message of messages) {
346 appendMessage(message.role, message.text, message.toolCalls);
347 chatHistory.push({ role: message.role, content: message.text });
348 }
349
350 if (messages.length > 0) {
351 chatArea.classList.remove("mode-welcome");
352 chatArea.classList.add("mode-chat");
353 } else {
354 chatArea.classList.remove("mode-chat");
355 chatArea.classList.add("mode-welcome");
356 }
357}
358
359function handleError(errorMsg) {
360 if (!currentAssistantMsg) {

Callers 1

initializeConversationFunction · 0.85

Calls 2

getConversationMessagesFunction · 0.90
appendMessageFunction · 0.85

Tested by

no test coverage detected