Skip to content

Commit

Permalink
Fixed mobile cse and stepper tool not running. (#2900)
Browse files Browse the repository at this point in the history
  • Loading branch information
JovenSoh committed Apr 3, 2024
1 parent d48834d commit 7ef667a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/commons/mobileWorkspace/MobileWorkspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ const MobileWorkspace: React.FC<MobileWorkspaceProps> = props => {
newTabId === SideContentType.mobileEditorRun &&
!(
prevTabId === SideContentType.substVisualizer ||
prevTabId === SideContentType.cseMachine ||
prevTabId === SideContentType.autograder ||
prevTabId === SideContentType.testcases
)
Expand All @@ -207,12 +208,14 @@ const MobileWorkspace: React.FC<MobileWorkspaceProps> = props => {
handleHideRepl();
}

// Disable draggable REPL when on the files & stepper tab.
// Disable draggable REPL when on the files & stepper & cse tab.
if (
newTabId === SideContentType.folder ||
newTabId === SideContentType.substVisualizer ||
newTabId === SideContentType.cseMachine ||
(prevTabId === SideContentType.substVisualizer &&
newTabId === SideContentType.mobileEditorRun)
newTabId === SideContentType.mobileEditorRun) ||
(prevTabId === SideContentType.cseMachine && newTabId === SideContentType.mobileEditorRun)
) {
setIsDraggableReplDisabled(true);
} else {
Expand Down
7 changes: 7 additions & 0 deletions src/commons/sideContent/SideContentHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,13 @@ export const useSideContent = (location: SideContentLocation, defaultTab?: SideC
const dispatch = useDispatch();
const setSelectedTab = useCallback(
(newId: SideContentType) => {
if (
(selectedTab === SideContentType.substVisualizer ||
selectedTab === SideContentType.cseMachine) &&
newId === SideContentType.mobileEditorRun
) {
return;
}
dispatch(visitSideContent(newId, selectedTab, location));
},
[dispatch, location, selectedTab]
Expand Down

0 comments on commit 7ef667a

Please sign in to comment.