small fixes

This commit is contained in:
Kujtim Hoxha 2025-04-09 19:18:51 +02:00
parent d39d52d95d
commit 635324d386
4 changed files with 5 additions and 4 deletions

View file

@ -18,7 +18,8 @@ func (w *writer) Write(p []byte) (int, error) {
d := logfmt.NewDecoder(bytes.NewReader(p))
for d.ScanRecord() {
msg := LogMessage{
ID: fmt.Sprintf("%d", time.Now().UnixNano()),
ID: fmt.Sprintf("%d", time.Now().UnixNano()),
Time: time.Now(),
}
for d.ScanKeyval() {
switch string(d.Key()) {

View file

@ -97,6 +97,6 @@ func (m statusCmp) model() string {
func NewStatusCmp() tea.Model {
return &statusCmp{
messageTTL: 15 * time.Second,
messageTTL: 10 * time.Second,
}
}

View file

@ -123,6 +123,7 @@ func (i *sessionsCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case tea.KeyMsg:
switch {
case key.Matches(msg, sessionKeyMapValue.Select):
i.app.Logger.PersistInfo("Session selected")
selected := i.list.SelectedItem()
if selected == nil {
return i, nil

View file

@ -131,6 +131,7 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
TTL: msg.Payload.PersistTime,
})
}
cmds = append(cmds, cmd)
}
case util.ClearStatusMsg:
a.status, _ = a.status.Update(msg)
@ -205,8 +206,6 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
}
a.status, cmd = a.status.Update(msg)
cmds = append(cmds, cmd)
if a.dialogVisible {
d, cmd := a.dialog.Update(msg)
a.dialog = d.(core.DialogCmp)