tui: call handleResize on states before transitioning
This commit is contained in:
@@ -125,12 +125,15 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
return m, cmd
|
||||
}
|
||||
case msgChangeState:
|
||||
switch msg {
|
||||
case stateChat:
|
||||
m.chat.handleResize(m.width, m.height)
|
||||
case stateConversations:
|
||||
m.conversations.handleResize(m.width, m.height)
|
||||
}
|
||||
m.state = state(msg)
|
||||
case tea.WindowSizeMsg:
|
||||
w, h := msg.Width, msg.Height
|
||||
m.width, m.height = w, h
|
||||
m.chat.width, m.chat.height = w, h
|
||||
m.conversations.width, m.conversations.height = w, h
|
||||
m.width, m.height = msg.Width, msg.Height
|
||||
case msgError:
|
||||
m.err = msg
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user