@@ -17,7 +17,7 @@ import { Menu } from './navigation/Navigation'
1717import { mobileAtom , settingsAtom } from './settings/settings-atoms'
1818import { lightThemes } from './settings/settings-types'
1919import { freshlyImportedCodeAtom } from './store/import-atoms'
20- import { projectAtom } from './store/project-atoms'
20+ import { currentProjectAtom } from './store/project-atoms'
2121import { screenWidthAtom } from './store/window-atoms'
2222import { save } from './utils/SaveToFile'
2323
@@ -35,7 +35,7 @@ function App() {
3535 const [ settings ] = useAtom ( settingsAtom )
3636 const [ mobile ] = useAtom ( mobileAtom )
3737 const [ , setScreenWidth ] = useAtom ( screenWidthAtom )
38- const [ project ] = useAtom ( projectAtom )
38+ const [ project ] = useAtom ( currentProjectAtom )
3939 const [ code , setCode ] = useAtom ( codeAtom )
4040 const [ freshlyImportedCode ] = useAtom ( freshlyImportedCodeAtom )
4141
@@ -76,7 +76,7 @@ function App() {
7676 ( window . location . protocol === 'https:' ? 'wss://' : 'ws://' ) +
7777 window . location . host +
7878 '/websocket/' +
79- project
79+ project . folder
8080 console . log ( `[Lean4web] Socket url is ${ socketUrl } ` )
8181 var _options : LeanMonacoOptions = {
8282 websocket : { url : socketUrl } ,
@@ -108,7 +108,7 @@ function App() {
108108
109109 // Setting up the editor and infoview
110110 useEffect ( ( ) => {
111- if ( project === undefined ) return
111+ if ( ! project ) return
112112 console . debug ( '[Lean4web] Restarting editor' )
113113 var _leanMonaco = new LeanMonaco ( )
114114 var leanMonacoEditor = new LeanMonacoEditor ( )
@@ -118,7 +118,7 @@ function App() {
118118 await _leanMonaco . start ( options )
119119 await leanMonacoEditor . start (
120120 editorRef . current ! ,
121- path . join ( project , `${ project } .lean` ) ,
121+ path . join ( project . folder , `${ project . folder } .lean` ) ,
122122 code ?? '' ,
123123 )
124124
0 commit comments