From d10226e91219d96622b3ff60a172ba7c022c5f9d Mon Sep 17 00:00:00 2001
From: tobi <31960611+tsmethurst@users.noreply.github.com>
Date: Mon, 19 Feb 2024 13:17:14 +0100
Subject: [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
---
web/template/page_header.tmpl | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'web')
diff --git a/web/template/page_header.tmpl b/web/template/page_header.tmpl
index dc727d144..5a2956883 100644
--- a/web/template/page_header.tmpl
+++ b/web/template/page_header.tmpl
@@ -26,7 +26,7 @@ Instance Logo
{{- end -}}
{{- define "strapUsers" -}}
-{{- with .instance.Stats.user_count -}}
+{{- with deref .instance.Stats.user_count -}}
{{- if eq . 1 -}}
{{- . -}} 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 -}}
{{- . -}} 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 -}}
{{- . -}} other instance
{{- else -}}
--
cgit v1.3