Add listeners and preload for log/toast from main

This commit is contained in:
jeffvli 2024-02-12 14:02:59 -08:00
parent 69f82a9427
commit b69290f9f2
3 changed files with 55 additions and 1 deletions

View file

@ -109,6 +109,19 @@ export const getMainWindow = () => {
return mainWindow;
};
export const sendToastToRenderer = ({
message,
type,
}: {
message: string;
type: 'success' | 'error' | 'warning' | 'info';
}) => {
getMainWindow()?.webContents.send('toast-from-main', {
message,
type,
});
};
const createWinThumbarButtons = () => {
if (isWindows()) {
getMainWindow()?.setThumbarButtons([