Skip to content
This repository has been archived by the owner on May 22, 2020. It is now read-only.

Commit

Permalink
RUN-2934 try/catch the call the getAllWindows (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
datamadic authored and StevenEBarbaro committed May 2, 2017
1 parent e7bb57f commit 3d85eda
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/browser/api/notifications/subscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,22 +166,26 @@ ofEvents.on('application/window-end-load/*', (e: any) => {

seqs.requestNoteClose
.subscribe((req: NotificationMessage) => {
const noteIsOpen = windowIsValid(req.id);
try {
const noteIsOpen = windowIsValid(req.id);

if (noteIsOpen) {
const ns = getCurrNotes();
const mousePos = System.getMousePosition();
const monitorInfo = getPrimaryMonitorAvailableRect();
const mouseOver = mouseisOverNotes(mousePos, monitorInfo, ns.length);
if (noteIsOpen) {
const ns = getCurrNotes();
const mousePos = System.getMousePosition();
const monitorInfo = getPrimaryMonitorAvailableRect();
const mouseOver = mouseisOverNotes(mousePos, monitorInfo, ns.length);

if (!mouseOver || req.data.force) {
closeNotification(req);
if (!mouseOver || req.data.force) {
closeNotification(req);

} else {
scheduleNoteClose(req, 1000);
}
} else {
scheduleNoteClose(req, 1000);
removePendingNote(req.id);
}
} else {
removePendingNote(req.id);
} catch (e) {
writeToLog('info', e);
}
});

Expand Down

0 comments on commit 3d85eda

Please sign in to comment.