mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-10 13:26:13 +00:00
Set chat session title to textContent of the chat session HTML element
We don't expect/want the user to use HTML titles for chat session
This commit is contained in:
@@ -104,7 +104,7 @@
|
|||||||
linkElement.classList.add("inline-chat-link");
|
linkElement.classList.add("inline-chat-link");
|
||||||
linkElement.classList.add("reference-link");
|
linkElement.classList.add("reference-link");
|
||||||
linkElement.setAttribute('title', title);
|
linkElement.setAttribute('title', title);
|
||||||
linkElement.innerHTML = title;
|
linkElement.textContent = title;
|
||||||
|
|
||||||
let referenceButton = document.createElement('button');
|
let referenceButton = document.createElement('button');
|
||||||
referenceButton.innerHTML = linkElement.outerHTML;
|
referenceButton.innerHTML = linkElement.outerHTML;
|
||||||
@@ -785,7 +785,7 @@
|
|||||||
let conversationButton = document.createElement('div');
|
let conversationButton = document.createElement('div');
|
||||||
let incomingConversationId = conversation["conversation_id"];
|
let incomingConversationId = conversation["conversation_id"];
|
||||||
const conversationTitle = conversation["slug"] || `New conversation 🌱`;
|
const conversationTitle = conversation["slug"] || `New conversation 🌱`;
|
||||||
conversationButton.innerHTML = conversationTitle;
|
conversationButton.textContent = conversationTitle;
|
||||||
conversationButton.classList.add("conversation-button");
|
conversationButton.classList.add("conversation-button");
|
||||||
if (incomingConversationId == conversationId) {
|
if (incomingConversationId == conversationId) {
|
||||||
conversationButton.classList.add("selected-conversation");
|
conversationButton.classList.add("selected-conversation");
|
||||||
@@ -883,7 +883,7 @@
|
|||||||
fetch(`${hostURL}${editURL}` , { method: "PATCH" })
|
fetch(`${hostURL}${editURL}` , { method: "PATCH" })
|
||||||
.then(response => response.ok ? response.json() : Promise.reject(response))
|
.then(response => response.ok ? response.json() : Promise.reject(response))
|
||||||
.then(data => {
|
.then(data => {
|
||||||
conversationButton.innerHTML = newTitle;
|
conversationButton.textContent = newTitle;
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ To get started, just start typing below. You can also type / to see a list of co
|
|||||||
linkElement.classList.add("inline-chat-link");
|
linkElement.classList.add("inline-chat-link");
|
||||||
linkElement.classList.add("reference-link");
|
linkElement.classList.add("reference-link");
|
||||||
linkElement.setAttribute('title', title);
|
linkElement.setAttribute('title', title);
|
||||||
linkElement.innerHTML = title;
|
linkElement.textContent = title;
|
||||||
|
|
||||||
let referenceButton = document.createElement('button');
|
let referenceButton = document.createElement('button');
|
||||||
referenceButton.innerHTML = linkElement.outerHTML;
|
referenceButton.innerHTML = linkElement.outerHTML;
|
||||||
@@ -713,7 +713,7 @@ To get started, just start typing below. You can also type / to see a list of co
|
|||||||
let conversationButton = document.createElement('div');
|
let conversationButton = document.createElement('div');
|
||||||
let incomingConversationId = conversation["conversation_id"];
|
let incomingConversationId = conversation["conversation_id"];
|
||||||
const conversationTitle = conversation["slug"] || `New conversation 🌱`;
|
const conversationTitle = conversation["slug"] || `New conversation 🌱`;
|
||||||
conversationButton.innerHTML = conversationTitle;
|
conversationButton.textContent = conversationTitle;
|
||||||
conversationButton.classList.add("conversation-button");
|
conversationButton.classList.add("conversation-button");
|
||||||
if (incomingConversationId == conversationId) {
|
if (incomingConversationId == conversationId) {
|
||||||
conversationButton.classList.add("selected-conversation");
|
conversationButton.classList.add("selected-conversation");
|
||||||
@@ -789,7 +789,7 @@ To get started, just start typing below. You can also type / to see a list of co
|
|||||||
fetch(editURL , { method: "PATCH" })
|
fetch(editURL , { method: "PATCH" })
|
||||||
.then(response => response.ok ? response.json() : Promise.reject(response))
|
.then(response => response.ok ? response.json() : Promise.reject(response))
|
||||||
.then(data => {
|
.then(data => {
|
||||||
conversationButton.innerHTML = newTitle;
|
conversationButton.textContent = newTitle;
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user