Skip to content

Commit

Permalink
add error check (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
JunNishimura committed Aug 6, 2023
1 parent d547e70 commit f273c44
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ui/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ type writeClientConfigMsg string

func (m *Model) setClientConfig(key config.ConfKey, value any) tea.Cmd {
start := time.Now()
m.cfg.Set(key, value)
if err := m.cfg.Set(key, value); err != nil {
return func() tea.Msg {
return errMsg{err: err}
}
}
elapsed := time.Since(start)

return tea.Tick(elapsed, func(t time.Time) tea.Msg {
Expand Down

0 comments on commit f273c44

Please sign in to comment.