Skip to content

Commit a13757b

Browse files
authored
Merge pull request #2614 from tekdi/release-prod-fix
Release prod fix to learner qa
2 parents c59687c + c676711 commit a13757b

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

apps/admin-app-repo/src/pages/importCsv.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ const ImportCsv = () => {
164164
const userProjectDetailsResponse = await getUserProjectDetails({
165165
id: courseId,
166166
});
167-
setUserProjectDetails(userProjectDetailsResponse?.result?.tasks);
167+
setUserProjectDetails(userProjectDetailsResponse?.result?.tasks?.filter((task: any) => task !== null && task !== undefined) || []);
168168
if (userProjectDetails?.length) {
169169
}
170170
setLoading(false);

apps/learner-web-app/src/components/Content/Player.tsx

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,7 @@ const PlayerBox = ({
621621
const theme = useTheme();
622622
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
623623
const [play, setPlay] = useState(false);
624+
const [isPortrait, setIsPortrait] = useState(false);
624625

625626
// Determine aspectRatio based on mimeType and mobile mode
626627
const getAspectRatio = () => {
@@ -630,6 +631,25 @@ const PlayerBox = ({
630631
return '16/9';
631632
};
632633

634+
// Check if device is in portrait mode (width < height)
635+
useEffect(() => {
636+
const checkOrientation = () => {
637+
setIsPortrait(window.innerWidth < window.innerHeight);
638+
};
639+
640+
// Check on mount
641+
checkOrientation();
642+
643+
// Listen for resize and orientation changes
644+
window.addEventListener('resize', checkOrientation);
645+
window.addEventListener('orientationchange', checkOrientation);
646+
647+
return () => {
648+
window.removeEventListener('resize', checkOrientation);
649+
window.removeEventListener('orientationchange', checkOrientation);
650+
};
651+
}, []);
652+
633653
useEffect(() => {
634654
if (checkAuth() || userIdLocalstorageName) {
635655
setPlay(true);
@@ -696,6 +716,9 @@ const PlayerBox = ({
696716
width: isShowMoreContent
697717
? '100%'
698718
: { xs: '100%', sm: '100%', md: '90%', lg: '80%', xl: '70%' },
719+
p:0,
720+
ml:-10,
721+
mr:-5,
699722
}}
700723
>
701724
<iframe
@@ -718,8 +741,8 @@ const PlayerBox = ({
718741
aspectRatio: getAspectRatio(),
719742
}}
720743
allowFullScreen
721-
width="100%"
722-
height="100%"
744+
width={"110%"}
745+
height={isPortrait ? '300%' : '100%'}
723746
title="Embedded Localhost"
724747
allow="accelerometer; gyroscope; autoplay; encrypted-media; picture-in-picture"
725748
frameBorder="0"

0 commit comments

Comments
 (0)