31 lines
527 B
Go
31 lines
527 B
Go
package tui
|
|
|
|
import (
|
|
"bee/audit/internal/app"
|
|
|
|
tea "github.com/charmbracelet/bubbletea"
|
|
)
|
|
|
|
func (m model) refreshSnapshotCmd() tea.Cmd {
|
|
if m.app == nil {
|
|
return nil
|
|
}
|
|
return func() tea.Msg {
|
|
return snapshotMsg{
|
|
banner: m.app.MainBanner(),
|
|
panel: m.app.LoadHardwarePanel(),
|
|
}
|
|
}
|
|
}
|
|
|
|
func shouldRefreshSnapshot(prev, next model) bool {
|
|
return prev.screen != next.screen || prev.busy != next.busy
|
|
}
|
|
|
|
func emptySnapshot() snapshotMsg {
|
|
return snapshotMsg{
|
|
banner: "",
|
|
panel: app.HardwarePanelData{},
|
|
}
|
|
}
|