mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Fix gitlabtodo usage of domain
Use domain in gitlabtodo Handle error in gitlabtodo
This commit is contained in:
parent
e43c37cc07
commit
4a7bdeab3c
@ -28,7 +28,7 @@ func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *co
|
|||||||
|
|
||||||
numberOfTodos: ymlConfig.UInt("numberOfTodos", 10),
|
numberOfTodos: ymlConfig.UInt("numberOfTodos", 10),
|
||||||
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_GITLAB_TOKEN")),
|
apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_GITLAB_TOKEN")),
|
||||||
domain: ymlConfig.UString("domain"),
|
domain: ymlConfig.UString("domain", "https://gitlab.com"),
|
||||||
showProject: ymlConfig.UBool("showProject", true),
|
showProject: ymlConfig.UBool("showProject", true),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *
|
|||||||
settings: settings,
|
settings: settings,
|
||||||
}
|
}
|
||||||
|
|
||||||
widget.gitlabClient, _ = gitlab.NewClient(settings.apiKey)
|
widget.gitlabClient, _ = gitlab.NewClient(settings.apiKey, gitlab.WithBaseURL(settings.domain))
|
||||||
|
|
||||||
widget.SetRenderFunction(widget.Render)
|
widget.SetRenderFunction(widget.Render)
|
||||||
widget.initializeKeyboardControls()
|
widget.initializeKeyboardControls()
|
||||||
@ -45,8 +45,9 @@ func (widget *Widget) Refresh() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
todos, _ := widget.getTodos(widget.settings.apiKey)
|
todos, err := widget.getTodos(widget.settings.apiKey)
|
||||||
widget.todos = todos
|
widget.todos = todos
|
||||||
|
widget.err = err
|
||||||
widget.SetItemCount(len(todos))
|
widget.SetItemCount(len(todos))
|
||||||
|
|
||||||
widget.Render()
|
widget.Render()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user