From e86caad06f28c8687e774c0c2a255d59245ea335 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Fri, 31 Mar 2023 22:15:24 -0700 Subject: [PATCH] Return hideViewerCount in config and set the admin switch correctly. Closes #2887 --- controllers/config.go | 2 ++ web/components/admin/config/general/EditInstanceDetails.tsx | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/controllers/config.go b/controllers/config.go index 212582e02..f98075bf3 100644 --- a/controllers/config.go +++ b/controllers/config.go @@ -35,6 +35,7 @@ type webConfigResponse struct { Federation federationConfigResponse `json:"federation"` Notifications notificationsConfigResponse `json:"notifications"` Authentication authenticationConfigResponse `json:"authentication"` + HideViewerCount bool `json:"hideViewerCount"` } type federationConfigResponse struct { @@ -135,6 +136,7 @@ func getConfigResponse() webConfigResponse { Notifications: notificationsResponse, Authentication: authenticationResponse, AppearanceVariables: data.GetCustomColorVariableValues(), + HideViewerCount: data.GetHideViewerCount(), } } diff --git a/web/components/admin/config/general/EditInstanceDetails.tsx b/web/components/admin/config/general/EditInstanceDetails.tsx index cb578aef0..c6ebf97fc 100644 --- a/web/components/admin/config/general/EditInstanceDetails.tsx +++ b/web/components/admin/config/general/EditInstanceDetails.tsx @@ -29,13 +29,14 @@ export default function EditInstanceDetails() { const serverStatusData = useContext(ServerStatusContext); const { serverConfig } = serverStatusData || {}; - const { instanceDetails, yp } = serverConfig; + const { instanceDetails, yp, hideViewerCount } = serverConfig; const { instanceUrl } = yp; useEffect(() => { setFormDataValues({ ...instanceDetails, ...yp, + hideViewerCount, }); }, [instanceDetails, yp]);