fix: make the shelf menus actually work
This commit is contained in:
@@ -43,6 +43,7 @@ func NewApp(name, version, host string, logger *zap.Logger) *App {
|
||||
}
|
||||
|
||||
app.assets = assets.NewAssets(logger, app.APIClient)
|
||||
app.shelves = shelves.NewShelves(logger, app.APIClient)
|
||||
|
||||
app.help = help.NewHelp(name, version)
|
||||
|
||||
|
||||
@@ -21,9 +21,11 @@ func (app *App) switchToPreviousScreen() {
|
||||
var previousScreen string
|
||||
switch app.currentPage {
|
||||
case app.help.GetTitle():
|
||||
previousScreen = app.assets.GetTitle()
|
||||
previousScreen = app.shelves.GetTitle()
|
||||
case app.assets.GetTitle():
|
||||
previousScreen = app.help.GetTitle()
|
||||
case app.shelves.GetTitle():
|
||||
previousScreen = app.assets.GetTitle()
|
||||
}
|
||||
app.switchToScreen(previousScreen)
|
||||
}
|
||||
@@ -34,6 +36,8 @@ func (app *App) switchToNextScreen() {
|
||||
case app.help.GetTitle():
|
||||
nextScreen = app.assets.GetTitle()
|
||||
case app.assets.GetTitle():
|
||||
nextScreen = app.shelves.GetTitle()
|
||||
case app.shelves.GetTitle():
|
||||
nextScreen = app.help.GetTitle()
|
||||
}
|
||||
app.switchToScreen(nextScreen)
|
||||
@@ -45,6 +49,8 @@ func (app *App) setPageFocus(page string) {
|
||||
app.Application.SetFocus(app.help)
|
||||
case app.assets.GetTitle():
|
||||
app.Application.SetFocus(app.assets)
|
||||
case app.shelves.GetTitle():
|
||||
app.Application.SetFocus(app.shelves)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,5 +58,7 @@ func (app *App) updatePageData(page string) {
|
||||
switch page {
|
||||
case app.assets.GetTitle():
|
||||
app.assets.UpdateData()
|
||||
case app.shelves.GetTitle():
|
||||
app.shelves.UpdateData()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user