Skip to content

Commit

Permalink
fix: fix minor ui issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jackMort committed Nov 7, 2024
1 parent f89a2f1 commit ec9d1f4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ func (i Call) Title() string {
return "untitled"
}

func (i Call) IsValid() bool {
if i.Url == "" {
return false
}
return true
}

func (i Call) Collection() *Collection {
app := GetInstance()
for _, c := range app.Collections {
Expand Down
2 changes: 1 addition & 1 deletion components/results/box.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func (b Results) View() string {
content = lipgloss.NewStyle().
Foreground(config.COLOR_GRAY).
Bold(true).
Render(lipgloss.PlaceVertical(b.viewport.Height-1, lipgloss.Center, center))
Render(lipgloss.PlaceVertical(b.viewport.Height, lipgloss.Center, center))
}

header := "Response"
Expand Down
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (m Model) Init() tea.Cmd {
m.tui.ModelMap[m.focused], focusCmd = m.tui.ModelMap[m.focused].Update(config.WindowFocusedMsg{State: true})

// set initial call if provided
if m.initialCall != nil {
if m.initialCall != nil && m.initialCall.IsValid() {
initalCallCmd = func() tea.Msg {
return app.CallSelectedMsg{Call: m.initialCall}
}
Expand Down Expand Up @@ -178,6 +178,9 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case popup.ClosePopupMsg:
m.popup = nil

case app.CallSelectedMsg:
m.SetFocused("url")

case tea.MouseMsg:
if msg.Type == tea.MouseLeft {
if zone.Get("method").InBounds(msg) {
Expand Down

0 comments on commit ec9d1f4

Please sign in to comment.