Browse Source

small fixes

Kujtim Hoxha 10 months ago
parent
commit
635324d386

+ 2 - 1
internal/logging/writer.go

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

+ 1 - 1
internal/tui/components/core/status.go

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

+ 1 - 0
internal/tui/components/repl/sessions.go

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

+ 1 - 2
internal/tui/tui.go

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