File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
CodeEdit/Features/Welcome/Views Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ struct RecentProjectsListView: View {
6060 }
6161
6262 Button ( " Remove from Recents " ) {
63- removeRecentProjects ( )
63+ removeRecentProjects ( items )
6464 }
6565 }
6666 } primaryAction: { items in
@@ -70,7 +70,7 @@ struct RecentProjectsListView: View {
7070 selection. map { NSItemProvider ( object: $0. path ( percentEncoded: false ) as NSString ) }
7171 }
7272 . onDeleteCommand {
73- removeRecentProjects ( )
73+ removeRecentProjects ( selection )
7474 }
7575 . background {
7676 if self . colorScheme == . dark {
@@ -116,12 +116,15 @@ struct RecentProjectsListView: View {
116116 }
117117 }
118118
119- func removeRecentProjects( ) {
120- recentProjects = RecentProjectsStore . removeRecentProjects ( selection )
119+ func removeRecentProjects( _ items : Set < URL > ) {
120+ recentProjects = RecentProjectsStore . removeRecentProjects ( items )
121121 }
122122
123123 func updateRecentProjects( ) {
124124 recentProjects = RecentProjectsStore . recentProjectURLs ( )
125+ if !recentProjects. isEmpty {
126+ selection = Set ( recentProjects. prefix ( 1 ) )
127+ }
125128 }
126129
127130 // MARK: - Key Handling
You can’t perform that action at this time.
0 commit comments