rewritten 3/4 db files and config to ts
This commit is contained in:
+4
-4
@@ -1427,7 +1427,7 @@ async function stopGeneration() {
|
||||
setNotice(res.stopped ? "Stopping generation..." : "Generation already finished.");
|
||||
}
|
||||
|
||||
async function setActiveChat(id, {preserveComposer = false} = {}) {
|
||||
async function setActiveChat(id, { preserveComposer = false } = {}) {
|
||||
if (!preserveComposer && id !== activeChatId) attachmentComposer.discard();
|
||||
if (isMobileLayout()) closeMobileSidebar();
|
||||
setChatLoading(true, "Opening chat...");
|
||||
@@ -1480,7 +1480,7 @@ async function loadChatSessions() {
|
||||
return setNotice("Pick a starting action to begin.", "success");
|
||||
}
|
||||
|
||||
async function createNewChat({preserveComposer = false} = {}) {
|
||||
async function createNewChat({ preserveComposer = false } = {}) {
|
||||
if (!preserveComposer) attachmentComposer.discard();
|
||||
setChatLoading(true, "Creating chat...");
|
||||
setChatActivity(true, {
|
||||
@@ -1494,7 +1494,7 @@ async function createNewChat({preserveComposer = false} = {}) {
|
||||
setChatActivity(false);
|
||||
return setNotice(res.error || "Unable to create chat.", "error");
|
||||
}
|
||||
chatSessions.unshift(res.chat); await loadSummary(); renderChatList(); await setActiveChat(res.chat.id, {preserveComposer}); setNotice("New chat created.", "success");
|
||||
chatSessions.unshift(res.chat); await loadSummary(); renderChatList(); await setActiveChat(res.chat.id, { preserveComposer }); setNotice("New chat created.", "success");
|
||||
msgInput.focus();
|
||||
setChatLoading(false);
|
||||
setChatActivity(false);
|
||||
@@ -1857,7 +1857,7 @@ async function sendMessage() {
|
||||
if (!message) return;
|
||||
const webSearch = webSearchToggle.enabled;
|
||||
const reasoning = reasoningToggle.enabled;
|
||||
if (!activeChatId) await createNewChat({preserveComposer: true});
|
||||
if (!activeChatId) await createNewChat({ preserveComposer: true });
|
||||
if (!activeChatId) return;
|
||||
const currentChat = getChatById(activeChatId);
|
||||
if (currentChat && !currentChat.assistant_persona_id && currentChat.title === "New chat") {
|
||||
|
||||
Reference in New Issue
Block a user