Skip to content

Commit

Permalink
Merge pull request #464 from RocketChat/bugfix/duplicate-notifications
Browse files Browse the repository at this point in the history
Remove duplicate notification on windows 7
  • Loading branch information
gdelavald authored Aug 2, 2017
2 parents 274a53c + 894da03 commit cfbb238
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 285 deletions.
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.

0 comments on commit cfbb238

Please sign in to comment.