fix module caching issue: dynamically import getAPIConfig in ui.js to prevent blog site button failure

This commit is contained in:
Russell Ballestrini 2025-07-11 00:02:45 -04:00
parent e9a1acf546
commit be508bcfb1

View file

@ -1,7 +1,7 @@
// UI creation and management functionality
import { marked } from "https://cdn.jsdelivr.net/npm/marked/lib/marked.esm.js";
import hljs from "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/es/highlight.min.js";
import { API_KEY, setSystemMessageAppend, TTS_API_URL, getAPIConfig } from "./config.js";
import { API_KEY, setSystemMessageAppend, TTS_API_URL } from "./config.js";
import { extractWebpageContent } from "./content.js";
import { detectPageLanguage } from "./language-detection.js";
import { speakText } from "./tts.js";
@ -114,7 +114,8 @@ function addCodeBlockCopyButtons(element) {
// Send message with custom history (for intro generation)
async function* sendMessageWithCustomHistory(messageHistory) {
// Get API configuration (custom or default)
// Dynamically import API configuration to avoid caching issues
const { getAPIConfig } = await import("./config.js");
const apiConfig = getAPIConfig();
let apiUrl, headers, model;