- commit
- 6db849f
- parent
- 2624c0e
- author
- Eric Bower
- date
- 2024-05-14 16:58:02 +0000 UTC
fix(pico): check for user in new tui pages
2 files changed,
+6,
-2
+3,
-1
1@@ -76,7 +76,9 @@ func NewModel(styles common.Styles, dbpool db.DB, user *db.User, session ssh.Ses
2 hh := headerHeight(styles)
3 viewport := viewport.New(headerWidth(pty.Window.Width), pty.Window.Height-hh)
4 viewport.YPosition = hh
5- viewport.SetContent(NotificationsView(dbpool, user.ID))
6+ if user != nil {
7+ viewport.SetContent(NotificationsView(dbpool, user.ID))
8+ }
9
10 return Model{
11 Done: false,
+3,
-1
1@@ -97,7 +97,9 @@ func NewModel(styles common.Styles, user *db.User, session ssh.Session) Model {
2 hh := headerHeight(styles)
3 viewport := viewport.New(headerWidth(pty.Window.Width), pty.Window.Height-hh)
4 viewport.YPosition = hh
5- viewport.SetContent(PlusView(user.Name))
6+ if user != nil {
7+ viewport.SetContent(PlusView(user.Name))
8+ }
9
10 return Model{
11 Done: false,