diff --git a/app/app.go b/app/app.go index cba77d6..2183191 100644 --- a/app/app.go +++ b/app/app.go @@ -32,21 +32,17 @@ func Setup() App { // Shortcuts to navigate the slides. app.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { - if event.Key() == tcell.KeyCtrlH { + switch ek := event.Key(); ek { + case tcell.KeyCtrlH: goToSection(helpSection) - return nil - } else if event.Key() == tcell.KeyCtrlB { + case tcell.KeyCtrlB: goToSection(blogsSection) - return nil - } else if event.Key() == tcell.KeyCtrlT { + case tcell.KeyCtrlT: goToSection(homeSection) - return nil - } else if event.Key() == tcell.KeyCtrlP { + case tcell.KeyCtrlP: goToSection(savedPostsSection) - return nil - } else if event.Key() == tcell.KeyCtrlX { + case tcell.KeyCtrlX: goToSection(settingsSection) - return nil } return event }) diff --git a/app/home.go b/app/home.go index d54c8e0..7bd13ee 100644 --- a/app/home.go +++ b/app/home.go @@ -17,7 +17,7 @@ func generateHomeList() { appCfg := cfg.GetAPPConfig() if len(appCfg.FollowingBlogs) == 0 { - listHome.AddItem("You're not following blogs", "Try follow a blog with Ctrl+S from the Blogs (Ctrl+B) page", ' ', nil) + listHome.AddItem("Welcome! You're not following any blog", "Try follow a blog with Ctrl+S from the Blogs (Ctrl+B) page", ' ', nil) } else { listHome.Clear() diff --git a/app/pages.go b/app/pages.go index e35fbac..fcc3a96 100644 --- a/app/pages.go +++ b/app/pages.go @@ -4,7 +4,6 @@ import ( "fmt" "strconv" - "github.com/ezeoleaf/tblogs/cfg" "github.com/rivo/tview" ) @@ -20,24 +19,14 @@ const ( ) func getPagesInfo() (*tview.Pages, *tview.TextView) { - appCfg := cfg.GetAPPConfig() + // appCfg := cfg.GetAPPConfig() // The presentation slides. slides := []slide{ homePage, savedPostsPage, blogsPage, settingsPage, - } - - highlight := homeSection - - if appCfg.FirstUse { - slides = append([]slide{helpPage}, slides...) - appCfg.FirstUse = false - highlight = helpSection - cfg.UpdateAppConfig(appCfg) - } else { - slides = append(slides, helpPage) + helpPage, } pages := tview.NewPages() @@ -62,7 +51,7 @@ func getPagesInfo() (*tview.Pages, *tview.TextView) { pages.AddPage(title, primitive, true, index == 0) fmt.Fprintf(info, `%d ["%s"][darkcyan]%s[white][""] `, index+1, title, title) } - info.Highlight(highlight) + info.Highlight(homeSection) return pages, info }