From 2d6ce560d4e1592bfd6a6a490aa0ee2836582e3b Mon Sep 17 00:00:00 2001 From: hlohaus <983577+hlohaus@users.noreply.github.com> Date: Sat, 8 Feb 2025 18:35:05 +0100 Subject: Fix issue with demo mode Fix issue with share API --- g4f/gui/client/static/js/chat.v1.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'g4f/gui/client') diff --git a/g4f/gui/client/static/js/chat.v1.js b/g4f/gui/client/static/js/chat.v1.js index 7f64a993..639e7821 100644 --- a/g4f/gui/client/static/js/chat.v1.js +++ b/g4f/gui/client/static/js/chat.v1.js @@ -1896,20 +1896,21 @@ async function on_load() { count_input(); if (/\/settings\//.test(window.location.href)) { open_settings(); - } else if (/\/chat\/[^?]+/.test(window.location.href)) { - load_conversation(window.conversation_id); - } else { + } else if (/\/chat\/share/.test(window.location.href)) { chatPrompt.value = document.getElementById("systemPrompt")?.value || ""; let chat_url = new URL(window.location.href) let chat_params = new URLSearchParams(chat_url.search); if (chat_params.get("prompt")) { - messageInput.value = `${window.location.href}\n`; + messageInput.value = chat_params.get("prompt"); messageInput.style.height = messageInput.scrollHeight + "px"; messageInput.focus(); //await handle_ask(); - } else { - say_hello() } + } else if (/\/chat\/[^?]+/.test(window.location.href)) { + load_conversation(window.conversation_id); + } else { + chatPrompt.value = document.getElementById("systemPrompt")?.value || ""; + say_hello(); } load_conversations(); } -- cgit v1.2.3