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

Function applyImportState

web/app.js:1347–1383  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1345 }
1346
1347 function applyImportState() {
1348 const state = loadImportState();
1349 if (!state) {
1350 return;
1351 }
1352 if (typeof state.provider === "string" && providerInput) {
1353 providerInput.value = normalizeProviderValue(state.provider);
1354 }
1355 if (typeof state.svgModel === "string" && svgModelInput) {
1356 svgModelInput.value = state.svgModel;
1357 }
1358 if (typeof state.apiKey === "string" && apiKeyInput) {
1359 apiKeyInput.value = state.apiKey;
1360 }
1361 if (typeof state.baseUrl === "string" && baseUrlInput) {
1362 baseUrlInput.value = state.baseUrl;
1363 }
1364 if (typeof state.samBackend === "string" && samBackend) {
1365 samBackend.value = state.samBackend;
1366 }
1367 if (typeof state.samPrompt === "string" && samPrompt) {
1368 samPrompt.value = state.samPrompt;
1369 }
1370 if (typeof state.samApiKey === "string" && samApiKeyInput) {
1371 samApiKeyInput.value = state.samApiKey;
1372 }
1373 if (typeof state.uploadedFigurePath === "string" && state.uploadedFigurePath) {
1374 uploadedFigurePath = state.uploadedFigurePath;
1375 }
1376 if (typeof state.previewUrl === "string" && state.previewUrl && figurePreview) {
1377 figurePreview.src = state.previewUrl;
1378 figurePreview.classList.add("visible");
1379 }
1380 if (typeof state.figureStatus === "string" && state.figureStatus && figureStatus) {
1381 figureStatus.textContent = state.figureStatus;
1382 }
1383 }
1384
1385 function setupChoiceGroup(group, input) {
1386 if (!group || !input) {

Callers 1

initImportPageFunction · 0.85

Calls 2

loadImportStateFunction · 0.85
normalizeProviderValueFunction · 0.85

Tested by

no test coverage detected