diff --git a/src/app/note/note.module.ts b/src/app/note/note.module.ts index 50cee317b6..31e80a4f0d 100644 --- a/src/app/note/note.module.ts +++ b/src/app/note/note.module.ts @@ -15,6 +15,9 @@ import { FormsModule } from '@angular/forms'; import { ReminderService } from '../reminder/reminder.service'; import { MatDialog } from '@angular/material'; import { DialogViewNoteReminderComponent } from './dialog-view-note-reminder/dialog-view-note-reminder.component'; +import { ElectronService } from 'ngx-electron'; +import { IPC_SHOW_OR_FOCUS } from '../../ipc-events.const'; +import { IS_ELECTRON } from '../app.constants'; @NgModule({ declarations: [ @@ -42,10 +45,15 @@ export class NoteModule { constructor( private readonly _reminderService: ReminderService, private readonly _matDialog: MatDialog, + private readonly _electronService: ElectronService, ) { let isDialogOpen = false; this._reminderService.onReminderActive$.subscribe(reminder => { + if (IS_ELECTRON) { + this._electronService.ipcRenderer.send(IPC_SHOW_OR_FOCUS); + } + if (!isDialogOpen && reminder && reminder.type === 'NOTE') { isDialogOpen = true; this._matDialog.open(DialogViewNoteReminderComponent, { diff --git a/src/ipc-events.const.ts b/src/ipc-events.const.ts index 92452d802d..d9af1d4b96 100644 --- a/src/ipc-events.const.ts +++ b/src/ipc-events.const.ts @@ -6,6 +6,7 @@ export const IPC_REGISTER_GLOBAL_SHORTCUT_EVENT = 'REGISTER_GLOBAL_SHORTCUT'; export const IPC_IDLE_TIME = 'IDLE_TIME'; export const IPC_NOTIFY = 'NOTIFY'; +export const IPC_SHOW_OR_FOCUS = 'SHOW_OR_FOCUS'; export const IPC_APP_READY = 'APP_READY'; export const IPC_ERROR = 'ELECTRON_ERROR';