Skip to content

Commit 7ef667a

Browse files
authored
Fixed mobile cse and stepper tool not running. (#2900)
1 parent d48834d commit 7ef667a

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/commons/mobileWorkspace/MobileWorkspace.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ const MobileWorkspace: React.FC<MobileWorkspaceProps> = props => {
198198
newTabId === SideContentType.mobileEditorRun &&
199199
!(
200200
prevTabId === SideContentType.substVisualizer ||
201+
prevTabId === SideContentType.cseMachine ||
201202
prevTabId === SideContentType.autograder ||
202203
prevTabId === SideContentType.testcases
203204
)
@@ -207,12 +208,14 @@ const MobileWorkspace: React.FC<MobileWorkspaceProps> = props => {
207208
handleHideRepl();
208209
}
209210

210-
// Disable draggable REPL when on the files & stepper tab.
211+
// Disable draggable REPL when on the files & stepper & cse tab.
211212
if (
212213
newTabId === SideContentType.folder ||
213214
newTabId === SideContentType.substVisualizer ||
215+
newTabId === SideContentType.cseMachine ||
214216
(prevTabId === SideContentType.substVisualizer &&
215-
newTabId === SideContentType.mobileEditorRun)
217+
newTabId === SideContentType.mobileEditorRun) ||
218+
(prevTabId === SideContentType.cseMachine && newTabId === SideContentType.mobileEditorRun)
216219
) {
217220
setIsDraggableReplDisabled(true);
218221
} else {

src/commons/sideContent/SideContentHelper.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ export const useSideContent = (location: SideContentLocation, defaultTab?: SideC
8686
const dispatch = useDispatch();
8787
const setSelectedTab = useCallback(
8888
(newId: SideContentType) => {
89+
if (
90+
(selectedTab === SideContentType.substVisualizer ||
91+
selectedTab === SideContentType.cseMachine) &&
92+
newId === SideContentType.mobileEditorRun
93+
) {
94+
return;
95+
}
8996
dispatch(visitSideContent(newId, selectedTab, location));
9097
},
9198
[dispatch, location, selectedTab]

0 commit comments

Comments
 (0)