mirror of
https://github.com/everoddandeven/monerod-gui.git
synced 2024-12-22 19:49:27 +00:00
Add notification icon
This commit is contained in:
parent
7ed673a5df
commit
a64d5778e9
1 changed files with 10 additions and 8 deletions
18
app/main.ts
18
app/main.ts
|
@ -60,7 +60,9 @@ if (!gotInstanceLock) {
|
||||||
let win: BrowserWindow | null = null;
|
let win: BrowserWindow | null = null;
|
||||||
let isHidden: boolean = false;
|
let isHidden: boolean = false;
|
||||||
let isQuitting: boolean = false;
|
let isQuitting: boolean = false;
|
||||||
|
const dirname = __dirname.endsWith('/app') ? __dirname.replace('/app', '/src') : __dirname;
|
||||||
let monerodProcess: ChildProcessWithoutNullStreams | null = null;
|
let monerodProcess: ChildProcessWithoutNullStreams | null = null;
|
||||||
|
const wdwIcon = path.join(dirname, 'assets/icons/monero-symbol-on-white-480.png');
|
||||||
|
|
||||||
const args = process.argv.slice(1),
|
const args = process.argv.slice(1),
|
||||||
serve = args.some(val => val === '--serve');
|
serve = args.some(val => val === '--serve');
|
||||||
|
@ -68,14 +70,6 @@ const args = process.argv.slice(1),
|
||||||
function createWindow(): BrowserWindow {
|
function createWindow(): BrowserWindow {
|
||||||
|
|
||||||
const size = screen.getPrimaryDisplay().workAreaSize;
|
const size = screen.getPrimaryDisplay().workAreaSize;
|
||||||
let dirname = __dirname;
|
|
||||||
|
|
||||||
if (dirname.endsWith('/app')) {
|
|
||||||
dirname = dirname.replace('/app', '/src')
|
|
||||||
}
|
|
||||||
|
|
||||||
const wdwIcon = path.join(dirname, 'assets/icons/monero-symbol-on-white-480.png');
|
|
||||||
|
|
||||||
const trayMenuTemplate: MenuItemConstructorOptions[] = [
|
const trayMenuTemplate: MenuItemConstructorOptions[] = [
|
||||||
{
|
{
|
||||||
id: "stopDaemon",
|
id: "stopDaemon",
|
||||||
|
@ -496,6 +490,14 @@ const extractTarBz2 = (filePath: string, destination: string): Promise<string> =
|
||||||
};
|
};
|
||||||
|
|
||||||
function showNotification(options?: NotificationConstructorOptions): void {
|
function showNotification(options?: NotificationConstructorOptions): void {
|
||||||
|
if (!options) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!options.icon) {
|
||||||
|
options.icon = wdwIcon;
|
||||||
|
}
|
||||||
|
|
||||||
new Notification(options).show();
|
new Notification(options).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue