Skip to content

Commit

Permalink
fix: colors not loading correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelroses committed May 29, 2024
1 parent 883660d commit 2ca2609
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ func (m Model) handleWindowSize(msg tea.WindowSizeMsg) Model {
m.table.SetHeight(height - lipgloss.Height(m.help.View(m.keys)) - lib.MainStyle.GetBorderBottomSize())

if !m.ready {
lib.LoadConfig(m.config)
m.feeds = lib.GetAllContent(m.urls, true)
m.viewport = viewport.New(width, height)

Expand Down
4 changes: 1 addition & 3 deletions cmd/modal.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ type Model struct {
help help.Model
context string
urls string
config string
keys keyMap
viewport viewport.Model
feeds lib.Feeds
Expand All @@ -35,7 +34,7 @@ func (m Model) Init() tea.Cmd {
}

// NewModel creates a new model with sensible defaults
func NewModel(urls string, config string) Model {
func NewModel(urls string) Model {
t := table.New(table.WithFocused(true))
t.SetStyles(lib.TableStyle())

Expand Down Expand Up @@ -65,6 +64,5 @@ func NewModel(urls string, config string) Model {
post: lib.Post{},
filter: f,
urls: urls,
config: config,
}
}
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/urfave/cli/v2"

"github.com/isabelroses/izrss/cmd"
"github.com/isabelroses/izrss/lib"
)

var version = "unstable"
Expand Down Expand Up @@ -48,7 +49,8 @@ CUSTOMIZATION:
},

Action: func(c *cli.Context) error {
p := tea.NewProgram(cmd.NewModel(c.String("urls"), c.String("config")), tea.WithAltScreen())
lib.LoadConfig(c.String("config"))
p := tea.NewProgram(cmd.NewModel(c.String("urls")), tea.WithAltScreen())
if _, err := p.Run(); err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit 2ca2609

Please sign in to comment.