fix: reset first view counter on browser start and skip warning during initialization (#3515)

mine
Ümüt Özalp 2025-08-20 16:51:04 +02:00 committed by GitHub
parent 67a637f7be
commit 41eeb5cc24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -170,6 +170,7 @@ func (b *Browser) Start() {
}
b.Stop()
b.firstView.Store(0) // Reset first view counter on each start
b.GetModel().AddListener(b)
b.Table.Start()
b.CmdBuff().AddListener(b)
@ -301,7 +302,8 @@ func (b *Browser) TableNoData(mdata *model1.TableData) {
if !b.app.ConOK() || cancel == nil || !b.app.IsRunning() {
return
}
if b.firstView.Load() == 0 {
// Skip warning on first view or if table data is empty (likely during initialization)
if b.firstView.Load() == 0 || mdata.Empty() {
b.firstView.Add(1)
return
}