[bugfix] Use ptr for instance stats entries to avoid skipping 0 values (#2666)

* [bugfix] Use ptr for instance stats entries to avoid skipping 0 values

* comment explaining why stats values are pointers
This commit is contained in:
tobi 2024-02-19 13:17:14 +01:00 committed by GitHub
commit d10226e912
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 8 deletions

View file

@ -26,7 +26,7 @@ Instance Logo
{{- end -}}
{{- define "strapUsers" -}}
{{- with .instance.Stats.user_count -}}
{{- with deref .instance.Stats.user_count -}}
{{- if eq . 1 -}}
<span class="count">{{- . -}}</span> user
{{- else -}}
@ -36,7 +36,7 @@ Instance Logo
{{- end -}}
{{- define "strapPosts" -}}
{{- with .instance.Stats.status_count -}}
{{- with deref .instance.Stats.status_count -}}
{{- if eq . 1 -}}
<span class="count">{{- . -}}</span> post
{{- else -}}
@ -46,7 +46,7 @@ Instance Logo
{{- end -}}
{{- define "strapInstances" -}}
{{- with .instance.Stats.domain_count -}}
{{- with deref .instance.Stats.domain_count -}}
{{- if eq . 1 -}}
<span class="count">{{- . -}}</span> other instance
{{- else -}}