fix: use .New() instead of the deprecated .NewModel() to init models

This commit is contained in:
2022-01-15 22:50:38 +02:00
parent e44f31f30a
commit f097431b8f
3 changed files with 6 additions and 8 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ type InputState struct {
}
func NewInputBox() InputState {
input := textinput.NewModel()
input := textinput.New()
input.Placeholder = "Send a message..."
input.Focus()
+4 -6
View File
@@ -51,16 +51,14 @@ type State struct {
}
func NewMainScreen(client *client.Client) State {
newViewport := &viewport.Model{
HighPerformanceRendering: false,
Wrap: viewport.Wrap,
Style: MessagesStyle.Copy(),
}
newViewport := viewport.New(0, 0)
newViewport.Wrap = viewport.Wrap
newViewport.Style = MessagesStyle.Copy()
return State{
ConnReader: nil,
Client: client,
Viewport: newViewport,
Viewport: &newViewport,
FocusIndex: InputBox,
InputBox: NewInputBox(),
SidePanel: NewSidePanel(client),