Skip to content

Commit

Permalink
Fix status bar indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
1buran committed Apr 3, 2024
1 parent d7fcef4 commit 4954703
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,8 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
m.resBodyLines = formatRespBody(
m.res.Header.Get("content-type"), string(buf),
m.checkboxes[checkboxIndex(autoformat)].IsOn())
sbar.SetResStatusCode(m.res.StatusCode)
sbar.SetResProto(m.res.Proto)
sbar.Info("request is executed, response taken")
if len(redirects) > 0 {
sbar.Warning(
Expand Down
10 changes: 10 additions & 0 deletions statusbar.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,16 @@ func (s *StatusBar) SetResTime(t time.Duration) {
s.resTime = t
}

// Set last response status code.
func (s *StatusBar) SetResStatusCode(c int) {
s.resStatusCode = c
}

// Set last response proto.
func (s *StatusBar) SetResProto(p string) {
s.resProto = p
}

// Set count of requests.
func (s *StatusBar) SetReqCount(c int) {
s.reqCount = c
Expand Down

0 comments on commit 4954703

Please sign in to comment.