Skip to content

Commit 7bb587a

Browse files
committed
Don't save workspace settings unnecessarily
1 parent 8904429 commit 7bb587a

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/core/Cline.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,17 @@ export class Cline {
193193

194194
// Add method to update diffStrategy
195195
async updateConversationSaveFolder(folder?: string) {
196-
// Update workspace configuration
197-
await vscode.workspace
198-
.getConfiguration("roo-cline")
199-
.update("conversationSaveFolder", folder, vscode.ConfigurationTarget.Workspace)
196+
// Check if the value has actually changed before updating
197+
const config = vscode.workspace.getConfiguration("roo-cline")
198+
const currentValue = config.get<string>("conversationSaveFolder")
199+
const newValue = folder || undefined
200+
201+
// Only update if the value has changed
202+
if (currentValue !== newValue) {
203+
// Update workspace configuration
204+
// Pass undefined to remove the setting entirely rather than setting it to an empty string
205+
await config.update("conversationSaveFolder", newValue, vscode.ConfigurationTarget.Workspace)
206+
}
200207

201208
// Update conversation saver instance
202209
if (typeof folder === "string" && folder.length > 0) {

0 commit comments

Comments
 (0)