Skip to content

Commit

Permalink
store frame values not references (#539)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
  • Loading branch information
wagoodman authored Feb 10, 2025
1 parent 790af2d commit 026e6f9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/quill/internal/ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func New(_, quiet bool) *UI {
h := handler.New()
return &UI{
handler: h,
frame: frame.New(),
frame: *frame.New(),
running: &sync.WaitGroup{},
quiet: quiet,
}
Expand All @@ -50,7 +50,7 @@ func New(_, quiet bool) *UI {
func (m *UI) Setup(subscription partybus.Unsubscribable) error {
// we still want to collect log messages, however, we also the logger shouldn't write to the screen directly
if logWrapper, ok := log.Get().(logger.Controller); ok {
logWrapper.SetOutput(m.frame.(*frame.Frame).Footer())
logWrapper.SetOutput(m.frame.(frame.Frame).Footer())
}

m.subscription = subscription
Expand Down Expand Up @@ -170,7 +170,9 @@ func (m *UI) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
continue
}
cmds = append(cmds, newModel.Init())
m.frame.(*frame.Frame).AppendModel(newModel)
f := m.frame.(frame.Frame)
f.AppendModel(newModel)
m.frame = f
}
// intentionally fallthrough to update the frame model
}
Expand Down

0 comments on commit 026e6f9

Please sign in to comment.