MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / refreshTabs

Method refreshTabs

internal/tui/app.go:279–301  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

277type localeChangedMsg struct{}
278
279func (a *App) refreshTabs() {
280 names := TabNames()
281 if a.logsEnabled {
282 a.tabs = names
283 } else {
284 filtered := make([]string, 0, len(names)-1)
285 for idx, name := range names {
286 if idx == tabLogs {
287 continue
288 }
289 filtered = append(filtered, name)
290 }
291 a.tabs = filtered
292 }
293
294 if len(a.tabs) == 0 {
295 a.activeTab = tabDashboard
296 return
297 }
298 if a.activeTab >= len(a.tabs) {
299 a.activeTab = len(a.tabs) - 1
300 }
301}
302
303func (a *App) initTabIfNeeded(_ int) tea.Cmd {
304 if a.initialized[a.activeTab] {

Callers 2

NewAppFunction · 0.95
UpdateMethod · 0.95

Calls 1

TabNamesFunction · 0.85

Tested by

no test coverage detected