MCPcopy
hub / github.com/ResearAI/AutoFigure-Edit / saveInputState

Function saveInputState

web/app.js:756–782  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

754 }
755
756 function saveInputState() {
757 const state = {
758 methodText: $("methodText")?.value ?? "",
759 provider: normalizeProviderValue(providerInput?.value ?? "gemini"),
760 imageProvider: normalizeImageProviderValue(imageProviderInput?.value ?? "same"),
761 imageModel: imageModelInput?.value ?? "",
762 svgModel: svgModelInput?.value ?? "",
763 apiKey: $("apiKey")?.value ?? "",
764 baseUrl: baseUrlInput?.value ?? DEFAULT_CUSTOM_BASE_URL,
765 imageApiKey: imageApiKeyInput?.value ?? "",
766 imageBaseUrl: imageBaseUrlInput?.value ?? DEFAULT_CUSTOM_BASE_URL,
767 optimizeIterations: $("optimizeIterations")?.value ?? "0",
768 imageSize: imageSizeInput?.value ?? "4K",
769 upscaleEnabled: upscaleEnabled?.checked ?? true,
770 samBackend: samBackend?.value ?? "roboflow",
771 samPrompt: samPrompt?.value ?? "icon,person,robot,animal",
772 samApiKey: samApiKeyInput?.value ?? "",
773 referencePath: uploadedReferencePath,
774 referenceUrl: referencePreview?.src ?? "",
775 referenceStatus: referenceStatus?.textContent ?? "",
776 };
777 try {
778 window.sessionStorage.setItem(INPUT_STATE_KEY, JSON.stringify(state));
779 } catch (_err) {
780 // Ignore storage failures (e.g. private mode / quota)
781 }
782 }
783
784 function applyInputState() {
785 const state = loadInputState();

Callers 3

syncRoutingControlsFunction · 0.85
syncSamApiKeyVisibilityFunction · 0.85
initInputPageFunction · 0.85

Calls 3

$Function · 0.85
normalizeProviderValueFunction · 0.85

Tested by

no test coverage detected