diff --git a/src/segments/wakatime.go b/src/segments/wakatime.go index 0cfbaed8..ee509ff4 100644 --- a/src/segments/wakatime.go +++ b/src/segments/wakatime.go @@ -21,13 +21,13 @@ type wtTotals struct { } type wtData struct { - CummulativeTotal wtTotals `json:"cummulative_total"` - Start string `json:"start"` - End string `json:"end"` + CumulativeTotal wtTotals `json:"cumulative_total"` + Start string `json:"start"` + End string `json:"end"` } func (w *Wakatime) Template() string { - return " {{ secondsRound .CummulativeTotal.Seconds }} " + return " {{ secondsRound .CumulativeTotal.Seconds }} " } func (w *Wakatime) Enabled() bool { diff --git a/src/segments/wakatime_test.go b/src/segments/wakatime_test.go index adef912d..2070f9da 100644 --- a/src/segments/wakatime_test.go +++ b/src/segments/wakatime_test.go @@ -73,8 +73,7 @@ func TestWTTrackedTime(t *testing.T) { for _, tc := range cases { env := &mock.MockedEnvironment{} - - response := fmt.Sprintf(`{"cummulative_total": {"seconds": %.2f, "text": "x"}}`, float64(tc.Seconds)) + response := fmt.Sprintf(`{"cumulative_total": {"seconds": %.2f, "text": "x"}}`, float64(tc.Seconds)) env.On("HTTPRequest", FAKEAPIURL).Return([]byte(response), tc.Error) diff --git a/website/docs/segments/wakatime.mdx b/website/docs/segments/wakatime.mdx index 314782ec..7d9301ae 100644 --- a/website/docs/segments/wakatime.mdx +++ b/website/docs/segments/wakatime.mdx @@ -53,7 +53,7 @@ If you don't want to include the API key into your configuration, the following } ``` -:::note +:::note `WAKATIME_API_KEY` is an example, **any name is possible and acceptable** as long as the environment variable exists and contains the API key value. @@ -66,7 +66,7 @@ Please refer to the [Environment Variable][templates-environment-variables] page :::note default template ```template -{{ secondsRound .CummulativeTotal.Seconds }} +{{ secondsRound .CumulativeTotal.Seconds }} ``` ::: @@ -75,7 +75,7 @@ Please refer to the [Environment Variable][templates-environment-variables] page | Name | Type | Description | | ------------------- | ---------- | ---------------------------------------- | -| `.CummulativeTotal` | `wtTotals` | object holding total tracked time values | +| `.CumulativeTotal` | `wtTotals` | object holding total tracked time values | ### wtTotals Properties