Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: GameDig widget missing lib #1811

Merged
merged 19 commits into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Moved fields limit to gamedig widget
  • Loading branch information
fredodiable committed Jul 26, 2023
commit 2f94c1ec2dba071a423a082699f40f955ec66389
7 changes: 0 additions & 7 deletions src/utils/config/service-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,6 @@ export function cleanServiceGroups(groups) {
} = cleanedService.widget;

let fieldsList = fields;

const MAX_ALLOWED_FIELDS = 4;
// Limits max number of displayed fields
if (fieldsList != null && fieldsList.length > MAX_ALLOWED_FIELDS) {
fieldsList = fieldsList.slice(0, MAX_ALLOWED_FIELDS);
}

if (typeof fields === 'string') {
try { JSON.parse(fields) }
catch (e) {
Expand Down
5 changes: 5 additions & 0 deletions src/widgets/gamedig/component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ export default function Component({ service }) {
if (widget.fields == null || widget.fields.length === 0) {
widget.fields = ["map", "currentPlayers", "ping"];
}
const MAX_ALLOWED_FIELDS = 4;
// Limits max number of displayed fields
if (widget.fields != null && widget.fields.length > MAX_ALLOWED_FIELDS) {
widget.fields = widget.fields.slice(0, MAX_ALLOWED_FIELDS);
}

if (!serverData) {
return (
Expand Down