mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Properly scope Config to the wtf package and remove it as a dependency from everywhere else
This commit is contained in:
@@ -21,10 +21,10 @@ func (widget *Widget) display() {
|
||||
str = str + widget.displayStats(repo)
|
||||
str = str + "\n"
|
||||
str = str + " [red]Open Review Requests[white]\n"
|
||||
str = str + widget.displayMyReviewRequests(repo, Config.UString("wtf.mods.github.username"))
|
||||
str = str + widget.displayMyReviewRequests(repo, wtf.Config.UString("wtf.mods.github.username"))
|
||||
str = str + "\n"
|
||||
str = str + " [red]My Pull Requests[white]\n"
|
||||
str = str + widget.displayMyPullRequests(repo, Config.UString("wtf.mods.github.username"))
|
||||
str = str + widget.displayMyPullRequests(repo, wtf.Config.UString("wtf.mods.github.username"))
|
||||
|
||||
widget.View.SetText(str)
|
||||
}
|
||||
|
||||
@@ -2,14 +2,10 @@ package github
|
||||
|
||||
import (
|
||||
"github.com/gdamore/tcell"
|
||||
"github.com/olebedev/config"
|
||||
"github.com/rivo/tview"
|
||||
"github.com/senorprogrammer/wtf/wtf"
|
||||
)
|
||||
|
||||
// Config is a pointer to the global config object
|
||||
var Config *config.Config
|
||||
|
||||
const HelpText = `
|
||||
Keyboard commands for Github:
|
||||
|
||||
@@ -41,7 +37,7 @@ func NewWidget(app *tview.Application, pages *tview.Pages) *Widget {
|
||||
pages: pages,
|
||||
}
|
||||
|
||||
widget.GithubRepos = widget.buildRepoCollection(Config.UMap("wtf.mods.github.repositories"))
|
||||
widget.GithubRepos = widget.buildRepoCollection(wtf.Config.UMap("wtf.mods.github.repositories"))
|
||||
|
||||
widget.View.SetInputCapture(widget.keyboardIntercept)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user