Browse Source

Return hideViewerCount in config and set the admin switch correctly. Closes #2887

pull/2896/head
Gabe Kangas 2 years ago
parent
commit
e86caad06f
No known key found for this signature in database
GPG Key ID: 4345B2060657F330
  1. 2
      controllers/config.go
  2. 3
      web/components/admin/config/general/EditInstanceDetails.tsx

2
controllers/config.go

@ -35,6 +35,7 @@ type webConfigResponse struct {
Federation federationConfigResponse `json:"federation"` Federation federationConfigResponse `json:"federation"`
Notifications notificationsConfigResponse `json:"notifications"` Notifications notificationsConfigResponse `json:"notifications"`
Authentication authenticationConfigResponse `json:"authentication"` Authentication authenticationConfigResponse `json:"authentication"`
HideViewerCount bool `json:"hideViewerCount"`
} }
type federationConfigResponse struct { type federationConfigResponse struct {
@ -135,6 +136,7 @@ func getConfigResponse() webConfigResponse {
Notifications: notificationsResponse, Notifications: notificationsResponse,
Authentication: authenticationResponse, Authentication: authenticationResponse,
AppearanceVariables: data.GetCustomColorVariableValues(), AppearanceVariables: data.GetCustomColorVariableValues(),
HideViewerCount: data.GetHideViewerCount(),
} }
} }

3
web/components/admin/config/general/EditInstanceDetails.tsx

@ -29,13 +29,14 @@ export default function EditInstanceDetails() {
const serverStatusData = useContext(ServerStatusContext); const serverStatusData = useContext(ServerStatusContext);
const { serverConfig } = serverStatusData || {}; const { serverConfig } = serverStatusData || {};
const { instanceDetails, yp } = serverConfig; const { instanceDetails, yp, hideViewerCount } = serverConfig;
const { instanceUrl } = yp; const { instanceUrl } = yp;
useEffect(() => { useEffect(() => {
setFormDataValues({ setFormDataValues({
...instanceDetails, ...instanceDetails,
...yp, ...yp,
hideViewerCount,
}); });
}, [instanceDetails, yp]); }, [instanceDetails, yp]);

Loading…
Cancel
Save