Skip to content

Commit

Permalink
fix(comment): open sidebar if it isn't open when commenting
Browse files Browse the repository at this point in the history
  • Loading branch information
Dolev Hadar committed Sep 30, 2022
1 parent b078f5f commit 0960a57
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ type Model struct {
prs []section.Section
issues []section.Section
ready bool
isSidebarOpen bool
tabs tabs.Model
ctx context.ProgramContext
taskSpinner spinner.Model
Expand Down Expand Up @@ -184,12 +183,13 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}

case key.Matches(msg, keys.PRKeys.Comment), key.Matches(msg, keys.IssueKeys.Comment):
m.isSidebarOpen = true
m.sidebar.IsOpen = true
if m.ctx.View == config.PRsView {
cmd = m.prSidebar.SetIsCommenting(true)
} else {
cmd = m.issueSidebar.SetIsCommenting(true)
}
m.syncMainContentWidth()
m.syncSidebar()
m.sidebar.ScrollToBottom()
return m, cmd
Expand Down

0 comments on commit 0960a57

Please sign in to comment.