Skip to content

Commit

Permalink
Make Google Spreadsheet widget work with new module lazy-loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Cummer committed Jun 13, 2018
1 parent 1b00c03 commit 5ee5557
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 1 addition & 5 deletions gspreadsheets/widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package gspreadsheets
import (
"fmt"

"github.com/senorprogrammer/wtf/wtf"
"github.com/olebedev/config"
"github.com/senorprogrammer/wtf/wtf"
sheets "google.golang.org/api/sheets/v4"
)

Expand All @@ -26,10 +26,6 @@ func NewWidget() *Widget {
/* -------------------- Exported Functions -------------------- */

func (widget *Widget) Refresh() {
if widget.Disabled() {
return
}

cells, _ := Fetch()

widget.UpdateRefreshedAt()
Expand Down
6 changes: 4 additions & 2 deletions wtf.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import (
"github.com/senorprogrammer/wtf/cryptoexchanges/bittrex"
"github.com/senorprogrammer/wtf/cryptoexchanges/cryptolive"
"github.com/senorprogrammer/wtf/gcal"
"github.com/senorprogrammer/wtf/gspreadsheets"
"github.com/senorprogrammer/wtf/git"
"github.com/senorprogrammer/wtf/github"
"github.com/senorprogrammer/wtf/gitlab"
"github.com/senorprogrammer/wtf/gspreadsheets"
"github.com/senorprogrammer/wtf/help"
"github.com/senorprogrammer/wtf/ipinfo"
"github.com/senorprogrammer/wtf/ipinfohigherlimit"
Expand Down Expand Up @@ -190,6 +190,8 @@ func addWidget(app *tview.Application, pages *tview.Pages, widgetName string) {
Widgets = append(Widgets, github.NewWidget(app, pages))
case "gitlab":
Widgets = append(Widgets, gitlab.NewWidget(app, pages))
case "gspreadsheets":
Widgets = append(Widgets, gspreadsheets.NewWidget())
case "ipinfo":
Widgets = append(Widgets, ipinfo.NewWidget())
case "ipinfohigherlimit":
Expand Down Expand Up @@ -231,10 +233,10 @@ func makeWidgets(app *tview.Application, pages *tview.Pages) {
cmdrunner.Config = Config
cryptolive.Config = Config
gcal.Config = Config
gspreadsheets.Config = Config
git.Config = Config
github.Config = Config
gitlab.Config = Config
gspreadsheets.Config = Config
ipinfo.Config = Config
ipinfohigherlimit.Config = Config
jira.Config = Config
Expand Down

0 comments on commit 5ee5557

Please sign in to comment.