Skip to content

Commit 07b81c7

Browse files
ibolton336claude
andauthored
🐛 Fix delayed profile deletion by ensuring immediate UI updates (#718)
- Fixed handleDeleteProfile to use dispatch() for immediate state updates - Removed duplicate message sending in handleMakeActive for consistency - Profile deletion now provides immediate visual feedback instead of delayed visibility Fixes #625 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - Bug Fixes - Improved reliability of deleting and activating profiles, ensuring changes reflect immediately in the UI. - Performance - Faster, more responsive interactions when deleting or making a profile active. - Refactor - Streamlined internal handling of profile actions to reduce latency and improve consistency across the Profile Manager. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Ian Bolton <[email protected]> Co-authored-by: Claude <[email protected]>
1 parent dc90f73 commit 07b81c7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

webview-ui/src/components/ProfileManager/ProfileManagerPage.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,14 @@ export const ProfileManagerPage: React.FC = () => {
7777
};
7878

7979
const handleDeleteProfile = (id: string) => {
80-
window.vscode.postMessage({ type: "DELETE_PROFILE", payload: id });
81-
setSelectedProfileId(null);
80+
dispatch({ type: "DELETE_PROFILE", payload: id });
81+
if (selectedProfileId === id) {
82+
setSelectedProfileId(null);
83+
}
8284
};
8385

8486
const handleMakeActive = (id: string) => {
8587
dispatch({ type: "SET_ACTIVE_PROFILE", payload: id });
86-
window.vscode.postMessage({ type: "SET_ACTIVE_PROFILE", payload: id });
8788
};
8889

8990
return (

0 commit comments

Comments
 (0)