const electron = require('electron');
const powerMonitor = electron.powerMonitor;
const BrowserWindow = electron.BrowserWindow;

powerMonitor.on('suspend', function() {
	console.log('The system is going to sleep');
});
powerMonitor.on('resume', function() {
	BrowserWindow.getAllWindows().forEach(function (win) {
		if (win.id > 1) {
			win.close()
		}else{
			win.reload();
		}
	});
});
