Skip to content

Commit 3c96c46

Browse files
committed
6871: Fixed issues in screen manager
1 parent da68e91 commit 3c96c46

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

assets/admin/components/screen/screen-manager.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ function ScreenManager({
7171
);
7272
setSavingScreen(false);
7373
}
74-
}, [saveErrorPut, saveErrorPost]);
74+
}, [saveErrorPut, saveErrorPost, t]);
7575

7676
/** If the screen is not loaded, display the error message */
7777
useEffect(() => {
7878
if (loadingError) {
7979
displayError(t("error-messages.load-screen-error", { id }), loadingError);
8080
}
81-
}, [loadingError, id]);
81+
}, [loadingError, id, t]);
8282

8383
/**
8484
* Set state on change in input field
@@ -136,7 +136,7 @@ function ScreenManager({
136136
*/
137137
function getPlaylistsByRegionId(playlists, regionId) {
138138
return playlists
139-
.filter(({ region }) => idFromUrl(region) === regionId)
139+
.filter(({ region }) => region === regionId)
140140
.map((playlist, index) => {
141141
return { id: idFromUrl(playlist["@id"]), weight: index };
142142
});
@@ -201,7 +201,7 @@ function ScreenManager({
201201
*/
202202
function getOrientation(screenState) {
203203
const { orientation } = screenState;
204-
return orientation ? orientation[0]["@id"] : "";
204+
return orientation && orientation.length > 0 ? orientation[0]["@id"] : "";
205205
}
206206

207207
/**
@@ -276,7 +276,7 @@ function ScreenManager({
276276
navigate("/screen/list");
277277
}
278278
}
279-
}, [isSaveSuccessPut, isSaveSuccessPost, postData]);
279+
}, [isSaveSuccessPut, isSaveSuccessPost, postData, navigate, t]);
280280

281281
return (
282282
<>

0 commit comments

Comments
 (0)