Skip to content

Commit 5ee5557

Browse files
author
Chris Cummer
committed
Make Google Spreadsheet widget work with new module lazy-loading
1 parent 1b00c03 commit 5ee5557

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

‎gspreadsheets/widget.go‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package gspreadsheets
33
import (
44
"fmt"
55

6-
"github.com/senorprogrammer/wtf/wtf"
76
"github.com/olebedev/config"
7+
"github.com/senorprogrammer/wtf/wtf"
88
sheets "google.golang.org/api/sheets/v4"
99
)
1010

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

2828
func (widget *Widget) Refresh() {
29-
if widget.Disabled() {
30-
return
31-
}
32-
3329
cells, _ := Fetch()
3430

3531
widget.UpdateRefreshedAt()

‎wtf.go‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ import (
1717
"github.com/senorprogrammer/wtf/cryptoexchanges/bittrex"
1818
"github.com/senorprogrammer/wtf/cryptoexchanges/cryptolive"
1919
"github.com/senorprogrammer/wtf/gcal"
20-
"github.com/senorprogrammer/wtf/gspreadsheets"
2120
"github.com/senorprogrammer/wtf/git"
2221
"github.com/senorprogrammer/wtf/github"
2322
"github.com/senorprogrammer/wtf/gitlab"
23+
"github.com/senorprogrammer/wtf/gspreadsheets"
2424
"github.com/senorprogrammer/wtf/help"
2525
"github.com/senorprogrammer/wtf/ipinfo"
2626
"github.com/senorprogrammer/wtf/ipinfohigherlimit"
@@ -190,6 +190,8 @@ func addWidget(app *tview.Application, pages *tview.Pages, widgetName string) {
190190
Widgets = append(Widgets, github.NewWidget(app, pages))
191191
case "gitlab":
192192
Widgets = append(Widgets, gitlab.NewWidget(app, pages))
193+
case "gspreadsheets":
194+
Widgets = append(Widgets, gspreadsheets.NewWidget())
193195
case "ipinfo":
194196
Widgets = append(Widgets, ipinfo.NewWidget())
195197
case "ipinfohigherlimit":
@@ -231,10 +233,10 @@ func makeWidgets(app *tview.Application, pages *tview.Pages) {
231233
cmdrunner.Config = Config
232234
cryptolive.Config = Config
233235
gcal.Config = Config
234-
gspreadsheets.Config = Config
235236
git.Config = Config
236237
github.Config = Config
237238
gitlab.Config = Config
239+
gspreadsheets.Config = Config
238240
ipinfo.Config = Config
239241
ipinfohigherlimit.Config = Config
240242
jira.Config = Config

0 commit comments

Comments
 (0)
⌂ 换网址