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

This commit is contained in:
Gabe Kangas 2023-03-31 22:15:24 -07:00
parent 197076d350
commit e86caad06f
No known key found for this signature in database
GPG Key ID: 4345B2060657F330
2 changed files with 4 additions and 1 deletions

View File

@ -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(),
}
}

View File

@ -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]);