mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 02:13:33 +00:00
Add listeners and preload for log/toast from main
This commit is contained in:
parent
69f82a9427
commit
b69290f9f2
3 changed files with 55 additions and 1 deletions
|
|
@ -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([
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue