MCPcopy Create free account
hub / github.com/experdot/pointer / handleCopyConfig

Function handleCopyConfig

src/renderer/src/components/settings/LLMSettings.tsx:291–310  ·  view source on GitHub ↗
(config: LLMConfig)

Source from the content-addressed store, hash-verified

289 }
290
291 const handleCopyConfig = (config: LLMConfig) => {
292 const currentConfigs = settings.llmConfigs || []
293 const hasDefaultConfig = settings.defaultLLMId
294
295 const newConfig: LLMConfig = {
296 ...config,
297 id: uuidv4(),
298 name: `${config.name} (副本)`,
299 createdAt: Date.now()
300 }
301
302 addLLMConfig(newConfig)
303
304 // 如果没有默认配置,则将新配置设为默认
305 if (!hasDefaultConfig) {
306 setDefaultLLM(newConfig.id)
307 }
308
309 message.success('配置已复制')
310 }
311
312 const handleSetDefault = (id: string) => {
313 setDefaultLLM(id)

Callers 1

getDropdownItemsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected