Skip to content

Commit 4c63bb9

Browse files
committed
fix(treeView): refresh favorite data
Add updateFavoriteEvent subscription to refresh the favorite tree view when favorites are updated. This ensures the UI stays in sync with the latest favorite items state.
1 parent 3174340 commit 4c63bb9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/core/treeView/views/favorite.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as vscode from 'vscode';
22
import { ViewId, Commands, RecentItemType } from '@/constants';
3-
import { globalStateEvent } from '@/core/event/events';
3+
import { globalStateEvent, updateFavoriteEvent } from '@/core/event/events';
44
import throttle from 'lodash-es/throttle';
55
import { IRecentItem, IWorktreeLess } from '@/types';
66
import { FolderItem, FileItem } from '@/core/treeView/items';
@@ -35,6 +35,7 @@ export class FavoriteDataProvider implements vscode.TreeDataProvider<FavoriteIte
3535
globalStateEvent.event((e) => {
3636
if (e === 'global.favorite') this.refresh();
3737
}),
38+
updateFavoriteEvent.event(this.refresh),
3839
this,
3940
);
4041
}

0 commit comments

Comments
 (0)