Skip to content

Commit 957ecc5

Browse files
committed
feat: add delay for UI refresh after mode deletion and update settings file tracking
1 parent 864d0d7 commit 957ecc5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/core/config/CustomModesManager.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,10 @@ export class CustomModesManager {
545545

546546
// Clear cache when modes are deleted
547547
this.clearCache()
548+
549+
// Add a small delay to ensure file operations are complete before refreshing UI
550+
await new Promise((resolve) => setTimeout(resolve, 100))
551+
548552
await this.refreshMergedState()
549553
})
550554
} catch (error) {
@@ -1069,6 +1073,12 @@ export class CustomModesManager {
10691073
source: "global",
10701074
}
10711075
addsForSettings.push(modeToAdd)
1076+
// Add a corresponding update entry for the settings file
1077+
const settingsPath = await this.getCustomModesFilePath()
1078+
if (!updatesByFile.has(settingsPath)) {
1079+
updatesByFile.set(settingsPath, [])
1080+
}
1081+
updatesByFile.get(settingsPath)!.push(update)
10721082
continue
10731083
}
10741084
console.warn(`Mode not found: ${update.slug}`)

0 commit comments

Comments
 (0)