mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 04:11:10 -05:00
Merge pull request #697 from samhvw8/fix/config-profile-rename-bug
fix: prevent unnecessary config operations when renaming to same name
This commit is contained in:
@@ -1222,6 +1222,10 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
|||||||
try {
|
try {
|
||||||
const { oldName, newName } = message.values
|
const { oldName, newName } = message.values
|
||||||
|
|
||||||
|
if (oldName === newName) {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
await this.configManager.saveConfig(newName, message.apiConfiguration)
|
await this.configManager.saveConfig(newName, message.apiConfiguration)
|
||||||
await this.configManager.deleteConfig(oldName)
|
await this.configManager.deleteConfig(oldName)
|
||||||
|
|
||||||
|
|||||||
@@ -60,6 +60,11 @@ const ApiConfigManager = ({
|
|||||||
if (editState === "new") {
|
if (editState === "new") {
|
||||||
onUpsertConfig(trimmedValue)
|
onUpsertConfig(trimmedValue)
|
||||||
} else if (editState === "rename" && currentApiConfigName) {
|
} else if (editState === "rename" && currentApiConfigName) {
|
||||||
|
if (currentApiConfigName === trimmedValue) {
|
||||||
|
setEditState(null)
|
||||||
|
setInputValue("")
|
||||||
|
return
|
||||||
|
}
|
||||||
onRenameConfig(currentApiConfigName, trimmedValue)
|
onRenameConfig(currentApiConfigName, trimmedValue)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user