| 4 | let loadingScreen: Electron.BrowserWindow | null; |
| 5 | |
| 6 | export function showLoadingScreen() { |
| 7 | loadingScreen = new BrowserWindow({ |
| 8 | width: 300, |
| 9 | height: 200, |
| 10 | frame: false, |
| 11 | transparent: false, |
| 12 | backgroundColor: "white" |
| 13 | }); |
| 14 | loadingScreen.loadFile(path.resolve(__dirname, '../../renderer/dist/loading.html')); |
| 15 | loadingScreen.on('closed', () => (loadingScreen = null)); |
| 16 | loadingScreen.show(); |
| 17 | // loadingScreen.webContents.openDevTools({ mode: 'detach' }) |
| 18 | } |
| 19 | |
| 20 | export function closeLoadingScreen() { |
| 21 | loadingScreen && loadingScreen?.close() |