diff --git a/src/main/index.ts b/src/main/index.ts index 4ff89c7..9fa0b09 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -241,6 +241,14 @@ function createWindow(): BrowserWindow { mainWindow.show() }) + mainWindow.on('enter-full-screen', () => { + mainWindow.setWindowButtonVisibility(false) + }) + + mainWindow.on('leave-full-screen', () => { + mainWindow.setWindowButtonVisibility(true) + }) + mainWindow.webContents.setWindowOpenHandler((details) => { shell.openExternal(details.url) return { action: 'deny' } diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx index 64e8a76..2c30187 100644 --- a/src/renderer/App.tsx +++ b/src/renderer/App.tsx @@ -39,8 +39,9 @@ export default function App(): JSX.Element { const switchProject = async (newPath: string): Promise => { await window.api.writeConfig({ projectPath: newPath }) clearActiveFile() - loadSession() - window.api.listFiles().then(setFileTree) + const files = await window.api.listFiles() + setFileTree(files) + await loadSession() } // Load file tree, restore prefs + session, and detect first run @@ -189,10 +190,11 @@ export default function App(): JSX.Element { { setSettingsOpen(false); setIsFirstRun(false) }} isSetup={isFirstRun} - onProjectChanged={() => { + onProjectChanged={async () => { clearActiveFile() - loadSession() - window.api.listFiles().then(setFileTree) + const files = await window.api.listFiles() + setFileTree(files) + await loadSession() }} /> )}