Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicate notification on windows 7 #464

Merged
merged 3 commits into from
Aug 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 0 additions & 66 deletions src/Toaster.js

This file was deleted.

22 changes: 0 additions & 22 deletions src/background.custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
// It doesn't have any windows which you can see on screen, but we can open
// window from here.

import os from 'os';
import { app, ipcMain, BrowserWindow } from 'electron';
import windowStateKeeper from './background/windowState';
import certificate from './background/certificate';
import Toaster from './Toaster';
import idle from '@paulcbetts/system-idle-time';
import { checkForUpdates } from './background/autoUpdate';

Expand Down Expand Up @@ -132,26 +130,6 @@ export function afterMainWindow (mainWindow) {
event.returnValue = idle.getIdleTime();
});

// Windows 7 and below
const useToaster = ['win32', 'win64'].indexOf(os.platform()) !== -1 &&
parseFloat(os.release()) < 6.2;

if (useToaster) {
const toaster = new Toaster(mainWindow);

ipcMain.on('notification-shim', (e, title, options) => {
toaster.toast({
title: title,
message: options.body,
icon: options.icon,
tag: options.tag,
width: 400,
timeout: 5000,
htmlFile: 'file://'+__dirname+'/public/notification.html'
}, () => e.sender.send(`clicked-${options.tag}`));
});
}

certificate.initWindow(mainWindow);

checkForUpdates();
Expand Down
4 changes: 0 additions & 4 deletions src/public/lib/Notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ class Notification extends window.Notification {

constructor (title, options) {
super(title, options);
ipcRenderer.send('notification-shim', title, options);

// Handle correct notification using unique tag
ipcRenderer.once(`clicked-${options.tag}`, () => this.onclick());
}

get onclick () {
Expand Down
193 changes: 0 additions & 193 deletions src/public/notification.html

This file was deleted.