diff --git a/index.html b/index.html index 2b3f886..5fbb70f 100644 --- a/index.html +++ b/index.html @@ -4262,6 +4262,7 @@ let isStreaming = false; let abortController = null; + let _apiKeyGeneration = 0; // ═══════════════════════════════════════════════════════════════════ // ZDR TELEMETRY — Open metadata collection for HuggingFace @@ -4598,6 +4599,7 @@ RESPOND WITH EXACTLY ONE LINE. No explanation, no preamble.`; // Store the key exactly like manual entry state.apiKey = data.key; + _apiKeyGeneration++; state.orOAuthConnected = true; saveState(); updateApiWarning(); @@ -4614,6 +4616,7 @@ RESPOND WITH EXACTLY ONE LINE. No explanation, no preamble.`; function disconnectOpenRouter() { state.apiKey = ''; + _apiKeyGeneration++; state.orOAuthConnected = false; saveState(); updateApiWarning(); @@ -10480,11 +10483,11 @@ Analyze and refine. Output ONLY the JSON object:` } const indicator = document.createElement('div'); indicator.className = `liquid-indicator ${config.class} ${config.pulse ? 'pulse' : ''}`; indicator.innerHTML = ` - ${config.icon} - ${config.text} + ${escapeHtml(config.icon)} + ${escapeHtml(config.text)} ${progressHtml} - ${config.subtext ? `${config.subtext}` : ''} - ${improvements.length > 0 ? `ⓘ` : ''} + ${config.subtext ? `${escapeHtml(config.subtext)}` : ''} + ${improvements.length > 0 ? `ⓘ` : ''} `; // Insert at the top of the message wrapper (before magic-info if exists) @@ -12165,7 +12168,9 @@ Ignoring conversation history will cause you to LOSE the evaluation.`; const encKey = localStorage.getItem('g0dm0d3-apikey'); if (encKey) { // Prefer the separate encrypted store + const genAtLoad = _apiKeyGeneration; decryptApiKey(encKey).then(plain => { + if (_apiKeyGeneration !== genAtLoad) return; state.apiKey = plain; updateApiWarning(); }); @@ -12797,8 +12802,8 @@ Ignoring conversation history will cause you to LOSE the evaluation.`; ? `${escapeHtml(msg.imageName || 'image')}` : ''; - // Vision badge for messages that had image processing - const visionBadge = (isUser && msg.imageDataUrl) + // Vision badge — only when vision analysis actually ran + const visionBadge = (isUser && msg.imageDataUrl && msg.visionAnalyzed) ? `
analyzed via Gemini Flash
` : ''; @@ -14071,6 +14076,7 @@ Ignoring conversation history will cause you to LOSE the evaluation.`; try { console.log(`[G0DM0D3] 📷 Processing image via ${VISION_MODEL}...`); visionContext = await processImageWithVision(attachedImage, content); + userMsg.visionAnalyzed = true; console.log('[G0DM0D3] ✓ Vision analysis complete'); } catch (err) { console.error('[G0DM0D3] Vision processing failed:', err); @@ -16297,6 +16303,7 @@ Ignoring conversation history will cause you to LOSE the evaluation.`; // If user manually changed the key, clear OAuth connected state if (newKey !== state.apiKey) state.orOAuthConnected = false; state.apiKey = newKey; + _apiKeyGeneration++; state.veniceApiKey = (document.getElementById('veniceKeyInput').value || '').trim(); state.model = document.getElementById('defaultModelInput').value; state.persona = document.getElementById('personaSelect').value;