Skip to content

Commit 6f85c20

Browse files
committed
feat: allow disabling refetch interval with 0 value
1 parent 72b8e10 commit 6f85c20

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

docs/data/schemas/defaults.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ schematize:
1010
default:
1111
details: |
1212
By default, the dashboard is configured to:
13-
13+
1414
- Display the preview pane with a width of 50 columns for all work items.
1515
- Only fetch 20 PRs and issues at a time for each section.
1616
- Display the PRs view when the dashboard loads.
@@ -61,7 +61,7 @@ properties:
6161
weight: 2
6262
details: |
6363
This setting defines how many PRs the dashboard should fetch for each section when:
64-
64+
6565
- The dashboard first loads.
6666
- The [sref:fetch interval] elapses.
6767
- You navigate to the next PR in a table without another fetched PR to display.
@@ -80,7 +80,7 @@ properties:
8080
weight: 3
8181
details: |
8282
This setting defines how many issues the dashboard should fetch for each section when:
83-
83+
8484
- The dashboard first loads.
8585
- The [sref:fetch interval] elapses.
8686
- You navigate to the next issue in a table without another fetched issue to display.
@@ -146,14 +146,16 @@ properties:
146146
147147
By default, the dashboard refetches work items every 30 minutes.
148148
149+
To disable the refetching interval set it to 0.
150+
149151
You can always use the [refresh current section] or [refresh all sections] command to
150152
refetch work items in the current view. If you change the search query for a view, the
151153
dashboard fetches results for the updated query immediately.
152154
153155
[refresh current section]: /getting-started/keybindings/global/#refresh-current-section
154156
[refresh all sections]: /getting-started/keybindings/global/#refresh-all-sections
155157
type: integer
156-
minimum: 1
158+
minimum: 0
157159
default: 30
158160
dateFormat:
159161
title: Date format

ui/ui.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,10 @@ func fetchUser() tea.Msg {
950950
type intervalRefresh time.Time
951951

952952
func (m *Model) doRefreshAtInterval() tea.Cmd {
953+
if m.ctx.Config.Defaults.RefetchIntervalMinutes == 0 {
954+
return nil
955+
}
956+
953957
return tea.Tick(
954958
time.Minute*time.Duration(m.ctx.Config.Defaults.RefetchIntervalMinutes),
955959
func(t time.Time) tea.Msg {

0 commit comments

Comments
 (0)