Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Git branch picker does not load list in branch picker initially #1637

Merged
merged 2 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions CodeEdit/Features/CodeEditUI/Views/ToolbarBranchPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ struct ToolbarBranchPicker: View {
}
.task {
await self.sourceControlManager?.refreshCurrentBranch()
await self.sourceControlManager?.refreshBranches()
}
}

Expand Down Expand Up @@ -159,9 +160,6 @@ struct ToolbarBranchPicker: View {
.padding(.top, 10)
.padding(5)
.frame(width: 340)
.task {
await sourceControlManager.refreshBranches()
}
}

func headerLabel(_ title: String) -> some View {
Expand Down Expand Up @@ -193,9 +191,6 @@ struct ToolbarBranchPicker: View {
self.title = title
}

@Environment(\.dismiss)
private var dismiss

var body: some View {
Button {
switchBranch()
Expand All @@ -215,9 +210,6 @@ struct ToolbarBranchPicker: View {
Task {
do {
try await sourceControlManager.checkoutBranch(branch: branch)
await MainActor.run {
dismiss()
}
} catch {
await sourceControlManager.showAlertForError(title: "Failed to checkout", error: error)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ struct SourceControlNavigatorHistoryView: View {
}
}
}
.onReceive(sourceControlManager.$currentBranch) { _ in
Task {
await updateCommitHistory()
}
}
.task {
await updateCommitHistory()
}
Expand Down
Loading