diff --git a/src/renderer/src/components/InstallConfigAsk/index.jsx b/src/renderer/src/components/InstallConfigAsk/index.jsx index 24950b2..d714450 100644 --- a/src/renderer/src/components/InstallConfigAsk/index.jsx +++ b/src/renderer/src/components/InstallConfigAsk/index.jsx @@ -1,6 +1,4 @@ import React from "react" -import { Icons, Icon } from "components/Icons" - import * as antd from "antd" import PKGConfigItem from "../PackageConfigItem" @@ -11,12 +9,12 @@ const InstallConfigAsk = (props) => { const { manifest } = props const [values, setValues] = React.useState({ - ...manifest.storaged_configs, - ...Object.keys(manifest.configs).reduce((prev, key) => { - prev[key] = manifest.configs[key].default + ...Object.entries(manifest.configs).reduce((acc, [key, value]) => { + acc[key] = value.default - return prev - }, {}) + return acc + }, {}), + ...manifest.storaged_configs, }) const [currentStep, setCurrentStep] = React.useState(0) @@ -74,10 +72,16 @@ const InstallConfigAsk = (props) => { const steps = manifest.install_ask_configs.map((key, index) => { const config = manifest.configs[key] + if (!config.id) { + config.id = key + } + + const storagedConfig = manifest.storaged_configs?.[key] ?? manifest.configs[key].default + return }) @@ -85,6 +89,8 @@ const InstallConfigAsk = (props) => { return steps }, []) + console.log(values) + return