From b79a4d6aeb2432392912b8df2470aa276e9b49ca Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Tue, 19 Nov 2024 10:39:22 +0100 Subject: Ask for auth on image upload --- g4f/gui/client/static/js/chat.v1.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'g4f/gui/client/static') diff --git a/g4f/gui/client/static/js/chat.v1.js b/g4f/gui/client/static/js/chat.v1.js index 9aba4f10..11306cdc 100644 --- a/g4f/gui/client/static/js/chat.v1.js +++ b/g4f/gui/client/static/js/chat.v1.js @@ -781,6 +781,7 @@ async function save_system_message() { } const hide_message = async (conversation_id, message_index =- 1) => { const conversation = await get_conversation(conversation_id) + if (!conversation) return; message_index = message_index == -1 ? conversation.items.length - 1 : message_index const last_message = message_index in conversation.items ? conversation.items[message_index] : null; if (last_message !== null) { @@ -817,6 +818,7 @@ const get_message = async (conversation_id, index) => { const add_message = async (conversation_id, role, content, provider) => { const conversation = await get_conversation(conversation_id); + if (!conversation) return; conversation.items.push({ role: role, content: content, -- cgit v1.2.3