mirror of
https://github.com/mrusme/neonmodem.git
synced 2024-12-04 14:46:37 -05:00
Updated ctx to include current sys/forum funcs
This commit is contained in:
parent
351049310f
commit
587bab0859
@ -15,6 +15,9 @@ type Ctx struct {
|
||||
Loading bool
|
||||
Logger *zap.SugaredLogger
|
||||
Theme *theme.Theme
|
||||
|
||||
currentSystem int
|
||||
currentForum string
|
||||
}
|
||||
|
||||
func New(
|
||||
@ -28,6 +31,9 @@ func New(
|
||||
Loading: false,
|
||||
Logger: logger,
|
||||
Theme: theme.New(cfg),
|
||||
|
||||
currentSystem: -1,
|
||||
currentForum: "",
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,3 +45,19 @@ func (c *Ctx) AddSystem(sys *system.System) error {
|
||||
func (c *Ctx) NumSystems() int {
|
||||
return len(c.Systems)
|
||||
}
|
||||
|
||||
func (c *Ctx) SetCurrentSystem(idx int) {
|
||||
c.currentSystem = idx
|
||||
}
|
||||
|
||||
func (c *Ctx) GetCurrentSystem() int {
|
||||
return c.currentSystem
|
||||
}
|
||||
|
||||
func (c *Ctx) SetCurrentForum(id string) {
|
||||
c.currentForum = id
|
||||
}
|
||||
|
||||
func (c *Ctx) GetCurrentForum() string {
|
||||
return c.currentForum
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user