Skip to content

Commit 61a7714

Browse files
author
Sine Jespersen
committed
2314: update mapgroups and remove check before mapping playlists
1 parent 539d5a0 commit 61a7714

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/components/screen/screen-manager.jsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,9 @@ function ScreenManager({
127127
* @returns {Array | null} A mapped array with group ids or null
128128
*/
129129
function mapGroups() {
130-
if (Array.isArray(formStateObject.inScreenGroups)) {
131-
return formStateObject.inScreenGroups.map((group) => {
132-
return idFromUrl(group);
133-
});
134-
}
135-
return null;
130+
return formStateObject.inScreenGroups.map((group) => {
131+
return idFromUrl(group);
132+
});
136133
}
137134

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

0 commit comments

Comments
 (0)