Fixed mayber

This commit is contained in:
tyler
2026-05-18 17:57:14 -04:00
parent 643c1d83b5
commit cdc83f1dac
+6 -3
View File
@@ -857,6 +857,7 @@ FRONTEND_JS_TEMPLATE = r"""
})();
(async () => {
console.log('[AI Answers] Script initializing, box:', document.getElementById('sxng-stream-box'));
const is_interactive = __IS_INTERACTIVE__;
const q_init = __JS_Q__;
const lang_init = __JS_LANG__;
@@ -876,8 +877,10 @@ FRONTEND_JS_TEMPLATE = r"""
turns: [{role: 'user', content: q_init, ts: Date.now()}]
};
const box = document.getElementById('sxng-stream-box');
if (!box) return;
const data = document.getElementById('sxng-stream-data');
const wrapper = box.closest('.answer');
if (!data) return;
const wrapper = box ? box.closest('.answer') : null;
// Hide native SearXNG answer entries but not our AI Overview
const answersContainer = document.getElementById('answers');
@@ -946,11 +949,10 @@ FRONTEND_JS_TEMPLATE = r"""
console.warn('[AI Answers] Stream already in progress, ignoring duplicate call');
return;
}
box.style.display = 'block';
isStreaming = true;
try {
const ctx = auxContext || conversation.originalContext;
box.style.display = 'block';
const controller = new AbortController();
let timeoutId = setTimeout(() => controller.abort(), 90000);
@@ -1171,6 +1173,7 @@ FRONTEND_JS_TEMPLATE = r"""
}
await loadPriorConversation();
console.log('[AI Answers] Calling startStream, restored:', restored);
if (!restored) startStream();
})();
"""