Remove API key prompt from custom.js
This commit is contained in:
1 parent
dab60ec8db
commit
430a36d3ca
1 file changed
+2
-9
+2
-9
@@ -1,15 +1,8 @@
|
||||
// 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;
|
||||
|
||||
Reference in new issue
Block a user