Skip to content

Commit

Permalink
2314: update mapgroups and remove check before mapping playlists
Browse files Browse the repository at this point in the history
  • Loading branch information
sinejespersen committed Oct 8, 2024
1 parent aa30622 commit 9a7f08f
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/components/screen/screen-manager.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,9 @@ function ScreenManager({
* @returns {Array | null} A mapped array with group ids or null
*/
function mapGroups() {
if (Array.isArray(formStateObject.inScreenGroups)) {
return formStateObject.inScreenGroups.map((group) => {
return idFromUrl(group);
});
}
return null;
return formStateObject.inScreenGroups.map((group) => {
return idFromUrl(group);
});
}

/**
Expand Down Expand Up @@ -175,7 +172,7 @@ function ScreenManager({
// The playlists all have a regionId, the following creates a unique list of relevant regions If there are not
// playlists, then an empty playlist is to be saved per region
let playlistRegions = [];
if (playlists.length > 0) {
if (playlists?.length > 0) {
playlistRegions = [...new Set(playlists.map(({ region }) => region))];
}

Expand Down

0 comments on commit 9a7f08f

Please sign in to comment.