Skip to content

Commit 7b309ed

Browse files
committed
5 secs
1 parent 2428625 commit 7b309ed

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

client/modules/IDE/pages/IDEView.jsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@ import PreviewFrame from '../components/PreviewFrame';
1212
import Console from '../components/Console';
1313
import Toast from '../components/Toast';
1414
import { updateFileContent } from '../actions/files';
15-
import { setPreviousPath, stopSketch } from '../actions/ide';
15+
import { stopSketch } from '../actions/ide';
1616
import {
1717
autosaveProject,
1818
clearPersistedState,
1919
getProject
2020
} from '../actions/project';
21-
import { selectActiveFile } from '../selectors/files';
2221
import { getIsUserOwner } from '../selectors/users';
2322
import RootPage from '../../../components/RootPage';
2423
import Header from '../components/Header';
@@ -72,7 +71,6 @@ export const CmControllerContext = React.createContext({});
7271

7372
const IDEView = (props) => {
7473
const ide = useSelector((state) => state.ide);
75-
const selectedFile = useSelector(selectActiveFile);
7674
const preferences = useSelector((state) => state.preferences);
7775
const project = useSelector((state) => state.project);
7876
const isUserOwner = useSelector(getIsUserOwner);
@@ -87,11 +85,6 @@ const IDEView = (props) => {
8785

8886
const autosaveIntervalRef = useRef(null);
8987

90-
const location = useLocation();
91-
92-
const prevFileNameRef = useRef(selectedFile.name);
93-
const locationRef = useRef(location.pathname);
94-
9588
const syncFileContent = () => {
9689
const file = cmRef.current.getContent();
9790
dispatch(updateFileContent(file.id, file.content));
@@ -123,16 +116,15 @@ const IDEView = (props) => {
123116
}
124117

125118
if (shouldAutosave) {
126-
autosaveIntervalRef.current = setTimeout(handleAutosave, 10000);
119+
autosaveIntervalRef.current = setTimeout(handleAutosave, 5000);
127120
}
128-
prevFileNameRef.current = selectedFile.name;
129121

130122
return () => {
131123
if (autosaveIntervalRef.current) {
132124
clearTimeout(autosaveIntervalRef.current);
133125
}
134126
};
135-
}, [shouldAutosave, dispatch]);
127+
}, [shouldAutosave, dispatch]);
136128

137129
return (
138130
<RootPage>

0 commit comments

Comments
 (0)