mirror of
https://github.com/gethomepage/homepage.git
synced 2026-09-30 16:01:17 -07:00
Chore: full react hooks eslint compliance (#7040)
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
export default function withWidgetFields(service, defaultFields, maxFields = 4) {
|
||||
const configuredFields = service.widget.fields;
|
||||
const fields = (configuredFields?.length ? configuredFields : defaultFields).slice(0, maxFields);
|
||||
|
||||
return {
|
||||
...service,
|
||||
widget: {
|
||||
...service.widget,
|
||||
fields,
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user