add splash screen on load
This commit is contained in:
parent
aa4b87d39d
commit
346bfcba01
9 changed files with 218 additions and 243 deletions
|
|
@ -35,7 +35,9 @@ export const initAudioIO = () => {
|
|||
});
|
||||
ai.on('data', (chunk: string) => {
|
||||
// turn string base64 data into buffer object.
|
||||
audioInput.push(Buffer.from(chunk, encoding));
|
||||
console.log('received string chunk of length', chunk.length)
|
||||
const buf = Buffer.from(chunk, encoding);
|
||||
audioInput.push(buf);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -54,7 +56,8 @@ export const updateRecorder = (_event, record: boolean): void => {
|
|||
} else {
|
||||
// stop mic data flow on space bar key up.
|
||||
ai.pause();
|
||||
sendAudio(Buffer.concat(audioInput));
|
||||
const audio = Buffer.concat(audioInput);
|
||||
sendAudio(audio);
|
||||
audioInput = [];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,10 +30,11 @@ let win: BrowserWindow | null;
|
|||
|
||||
const windowMount = (): void => {
|
||||
backgroundMitt.emit('window-active', true);
|
||||
ipcMain.removeAllListeners('update-recorder');
|
||||
ipcMain.on('update-recorder', updateRecorder);
|
||||
// handle renderer auth-token event
|
||||
ipcMain.removeHandler('nav-bar'); // avoid setting duplicate handlers
|
||||
ipcMain.handle('nav-bar', navBarHandler);
|
||||
// handle renderer auth-token event
|
||||
ipcMain.removeHandler('nav-bar'); // avoid setting duplicate handlers
|
||||
ipcMain.handle('nav-bar', navBarHandler);
|
||||
}
|
||||
|
||||
const windowDismount = (): void => {
|
||||
|
|
@ -58,6 +59,7 @@ export const createWindow = async (options: WindowSettings): Promise<void> => {
|
|||
width: options.width,
|
||||
height: options.height,
|
||||
resizable: options.resizable,
|
||||
backgroundColor: '#EBEBEB',
|
||||
frame: false,
|
||||
minWidth: 350,
|
||||
minHeight: 500,
|
||||
|
|
@ -82,8 +84,12 @@ export const createWindow = async (options: WindowSettings): Promise<void> => {
|
|||
// Handle window close.
|
||||
win.on("closed", windowDismount);
|
||||
|
||||
win.once('ready-to-show', () => {
|
||||
if (win) win.show()
|
||||
})
|
||||
|
||||
win.webContents.on('did-finish-load', () => {
|
||||
windowMount();
|
||||
windowMount();
|
||||
resolve();
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue