@@ -12,13 +12,12 @@ import PreviewFrame from '../components/PreviewFrame';
1212import Console from '../components/Console' ;
1313import Toast from '../components/Toast' ;
1414import { updateFileContent } from '../actions/files' ;
15- import { setPreviousPath , stopSketch } from '../actions/ide' ;
15+ import { stopSketch } from '../actions/ide' ;
1616import {
1717 autosaveProject ,
1818 clearPersistedState ,
1919 getProject
2020} from '../actions/project' ;
21- import { selectActiveFile } from '../selectors/files' ;
2221import { getIsUserOwner } from '../selectors/users' ;
2322import RootPage from '../../../components/RootPage' ;
2423import Header from '../components/Header' ;
@@ -72,7 +71,6 @@ export const CmControllerContext = React.createContext({});
7271
7372const 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