Remove API key prompt from custom.js

This commit is contained in:
Nathan Schneider committed 2026-10-18 22:01:01 -06:00
1 parent dab60ec8db
commit 430a36d3ca
1 file changed
+3 -10
+3 -10
View File
@@ -1,17 +1,10 @@
// Auto‑load saved image‑generation API key into the MCP input field.
// If no key is stored, prompt the user once and persist it in localStorage.
// If the user has previously stored a key, it will be inserted; otherwise nothing is shown.
window.addEventListener('load', () => {
const storageKey = 'image_api_key';
let savedKey = localStorage.getItem(storageKey);
if (!savedKey) {
// Prompt user only once per browser session
savedKey = prompt('Enter your Inference Co‑op image‑generation API key (will be saved locally):');
if (savedKey) {
localStorage.setItem(storageKey, savedKey);
}
}
const savedKey = localStorage.getItem(storageKey);
if (savedKey) {
const icInput = document.querySelector('input[name="IC_API_KEY"]');
if (icInput) icInput.value = savedKey;
}
});
});