fix: hide community stats/tree on about page for non-logged-in users

This commit is contained in:
Davide Scaini
2026-04-10 17:40:16 +02:00
parent 96a3deee5d
commit a20df6bd57
4 changed files with 16 additions and 0 deletions
+4
View File
@@ -143,6 +143,10 @@ const labels = {
<script define:vars={{ labels }}>
(async () => {
try {
const me = await fetch('/api/me', { credentials: 'include' });
if (!me.ok) return;
} catch { return; }
let data;
try {
const r = await fetch('/api/stats');
+4
View File
@@ -142,6 +142,10 @@ const labels = {
<script define:vars={{ labels }}>
(async () => {
try {
const me = await fetch('/api/me', { credentials: 'include' });
if (!me.ok) return;
} catch { return; }
let data;
try {
const r = await fetch('/api/stats');
+4
View File
@@ -139,6 +139,10 @@ const labels = {
<script define:vars={{ labels }}>
(async () => {
try {
const me = await fetch('/api/me', { credentials: 'include' });
if (!me.ok) return; // not logged in — hide community section
} catch { return; }
let data;
try {
const r = await fetch('/api/stats');
+4
View File
@@ -142,6 +142,10 @@ const labels = {
<script define:vars={{ labels }}>
(async () => {
try {
const me = await fetch('/api/me', { credentials: 'include' });
if (!me.ok) return;
} catch { return; }
let data;
try {
const r = await fetch('/api/stats');