diff --git a/public/script.js b/public/script.js index b57dad454..759a7462b 100644 --- a/public/script.js +++ b/public/script.js @@ -173,6 +173,7 @@ import { escapeHtml, saveBase64AsFile, uuidv4, + equalsIgnoreCaseAndAccents, } from './scripts/utils.js'; import { debounce_timeout, IGNORE_SYMBOL } from './scripts/constants.js'; @@ -9878,6 +9879,11 @@ export async function renameChat(oldFileName, newName) { renamed_file: `${newName.trim()}.jsonl`, }; + if (equalsIgnoreCaseAndAccents(body.original_file, body.renamed_file)) { + console.warn('Chat name is the same (ignoring case and accents)'); + return; + } + try { showLoader(); const response = await fetch('/api/chats/rename', {