Skip to content
This repository has been archived by the owner on Jun 4, 2023. It is now read-only.

Commit

Permalink
feat: show notification on download start
Browse files Browse the repository at this point in the history
closes #201
  • Loading branch information
sentialx committed Jun 25, 2019
1 parent a8e8b1a commit d539a37
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/renderer/app/store/downloads.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { observable } from 'mobx';
import { DownloadItem } from '../models/download-item';
import { ipcRenderer } from 'electron';
import store from '.';

export class DownloadsStore {
@observable
Expand All @@ -9,6 +10,14 @@ export class DownloadsStore {
constructor() {
ipcRenderer.on('download-started', (e: any, item: DownloadItem) => {
this.list.push(item);

const not = new Notification(`Downloading ${item.fileName}`, {
body: 'Open Overlay to see the downloads.',
});

not.onclick = () => {
store.overlay.visible = true;
};
});

ipcRenderer.on('download-progress', (e: any, item: DownloadItem) => {
Expand Down

0 comments on commit d539a37

Please sign in to comment.