Skip to content

Commit

Permalink
Git branch picker not load branch list and switch branch issue (CodeE…
Browse files Browse the repository at this point in the history
…ditApp#1637)

* fix: branch picker refresh issue and switch branch issue

* fix: source control history view not refresh after switch branch
  • Loading branch information
phlpsong authored and FastestMolasses committed Apr 11, 2024
1 parent d1911ac commit 7c04cef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
10 changes: 1 addition & 9 deletions CodeEdit/Features/CodeEditUI/Views/ToolbarBranchPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ struct ToolbarBranchPicker: View {
}
.task {
await self.sourceControlManager?.refreshCurrentBranch()
await self.sourceControlManager?.refreshBranches()
}
}

Expand Down Expand Up @@ -160,9 +161,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 @@ -194,9 +192,6 @@ struct ToolbarBranchPicker: View {
self.title = title
}

@Environment(\.dismiss)
private var dismiss

var body: some View {
Button {
switchBranch()
Expand All @@ -216,9 +211,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 @@ -98,6 +98,11 @@ struct SourceControlNavigatorHistoryView: View {
}
}
}
.onReceive(sourceControlManager.$currentBranch) { _ in
Task {
await updateCommitHistory()
}
}
.task {
await updateCommitHistory()
}
Expand Down

0 comments on commit 7c04cef

Please sign in to comment.